Directed self-assembly of small molecules in living systems could enable a myriad of applications in biology and medicine, and already this has been used widely to synthesize supramolecules and nano/microstructures in solution and in living cells. However, controlling the self-assembly of synthetic small molecules in living animals is challenging because of the complex and dynamic in vivo physiological environment. Here we employ an optimized first-order bioorthogonal cyclization reaction to control the self-assembly of a fluorescent small molecule, and demonstrate its in vivo applicability by imaging caspase-3/7 activity in human tumour xenograft mouse models of chemotherapy. The fluorescent nanoparticles assembled in situ were imaged successfully in both apoptotic cells and tumour tissues using three-dimensional structured illumination microscopy. This strategy combines the advantages offered by small molecules with those of nanomaterials and should find widespread use for non-invasive imaging of enzyme activity in vivo.