Neuronal-activity-dependent transcription couples sensory experience to adaptive responses of the brain including learning and memory. Mechanisms of activity-dependent gene expression including alterations of the epigenome have been characterized1–8. However, the fundamental question of whether sensory experience remodels chromatin architecture in the adult brain in vivo to induce neural code transformations and learning and memory remains to be addressed. Here we use in vivo calcium imaging, optogenetics and pharmacological approaches to show that granule neuron activation in the anterior dorsal cerebellar vermis has a crucial role in a delay tactile startle learning paradigm in mice. Of note, using large-scale transcriptome and chromatin profiling, we show that activation of the motor-learning-linked granule neuron circuit reorganizes neuronal chromatin including through long-distance enhancer–promoter and transcriptionally active compartment interactions to orchestrate distinct granule neuron gene expression modules. Conditional CRISPR knockout of the chromatin architecture regulator cohesin in anterior dorsal cerebellar vermis granule neurons in adult mice disrupts enhancer–promoter interactions, activity-dependent transcription and motor learning. These findings define how sensory experience patterns chromatin architecture and neural circuit coding in the brain to drive motor learning.