In vivo calcium imaging from axons provides direct interrogation of afferent neural activity, informing the neural representations that a local circuit receives. Unlike in somata and dendrites, axonal recording of neural activity-both electrically and optically-has been difficult to achieve, thus preventing comprehensive understanding of neuronal circuit function. Here we developed an active transportation strategy to enrich GCaMP6, a genetically encoded calcium indicator, uniformly in axons with sufficient brightness, signal-to-noise ratio, and photostability to allow robust, structure-specific imaging of presynaptic activity in awake mice. Axon-targeted GCaMP6 enables frame-to-frame correlation for motion correction in axons and permits subcellular-resolution recording of axonal activity in previously inaccessible deep-brain areas. We used axon-targeted GCaMP6 to record layer-specific local afferents without contamination from somata or from intermingled dendrites in the cortex. We expect that axon-targeted GCaMP6 will facilitate new applications in investigating afferent signals relayed by genetically defined neuronal populations within and across specific brain regions.