Crystallographic phase engineering plays an important part in the precise control of the physical and electronic properties of materials. In two-dimensional transition metal dichalcogenides (2D TMDs), phase engineering using chemical lithiation with the organometallization agent n-butyllithium (n-BuLi), to convert the semiconducting 2H (trigonal) to the metallic 1T (octahedral) phase, has been widely explored for applications in areas such as transistors, catalysis and batteries1–15. Although this chemical phase engineering can be performed at ambient temperatures and pressures, the underlying mechanisms are poorly understood, and the use of n-BuLi raises notable safety concerns. Here we optically visualize the archetypical phase transition from the 2H to the 1T phase in mono- and bilayer 2D TMDs and discover that this reaction can be accelerated by up to six orders of magnitude using low-power illumination at 455 nm. We identify that the above-gap illumination improves the rate-limiting charge-transfer kinetics through a photoredox process. We use this method to achieve rapid and high-quality phase engineering of TMDs and demonstrate that this methodology can be harnessed to inscribe arbitrary phase patterns with diffraction-limited edge resolution into few-layer TMDs. Finally, we replace pyrophoric n-BuLi with safer polycyclic aromatic organolithiation agents and show that their performance exceeds that of n-BuLi as a phase transition agent. Our work opens opportunities for exploring the in situ characterization of electrochemical processes and paves the way for sustainably scaling up materials and devices by photoredox phase engineering.