Activity remodels neurons, altering their molecular, structural, and electrical characteristics. To enable the selective characterization and manipulation of these neurons, we present FLARE, an engineered transcription factor that drives expression of fluorescent proteins, opsins, and other genetically encoded tools only in the subset of neurons that experienced activity during a user-defined time window. FLARE senses the coincidence of elevated cytosolic calcium and externally applied blue light, which together produce translocation of a membrane-anchored transcription factor to the nucleus to drive expression of any transgene. In cultured rat neurons, FLARE gives a light-to-dark signal ratio of 120 and a high- to low-calcium signal ratio of 10 after 10 min of stimulation. Opsin expression permitted functional manipulation of FLARE-marked neurons. In adult mice, FLARE also gave light- and motor-activity-dependent transcription in the cortex. Due to its modular design, minute-scale temporal resolution, and minimal dark-state leak, FLARE should be useful for the study of activity-dependent processes in neurons and other cells that signal with calcium.