Environment-responsive in situ synthesis of molecular fluorescent dyes is challenging. Herein, we develop a photoextension strategy to make trimethine cyanines with decent conversion efficiency (up to 81 %) using 1-butyl 2,3,3-trimethyl 3H-indole derivatives as the sole precursors, and demonstrate a free radical mechanism. In the inducer-extension stage, free radicals and reactive oxygen species (ROS) were able to mediate similar reactions with no assistance of light. We explored a Mito-extension strategy to in situ synthesize trimethine cyanines in the living cells. The cellular ROS-dependence provided a foundation for preferential cyanine expression in cancer cells. Finally, we applied an iodized precursor as an intrinsic ROS-activated theranostic agent that integrated mitochondria-targeted cyanine synthesis, cell imaging and phototherapy.