SUMMARYPurposeful behavior requires planning of actions based on external information. However, neuronal mechanisms converting sensory input into a motor plan remain elusive. Here, we combined wide-field calcium imaging, multi-area single-neuron recordings and focal optogenetic inactivation to reveal the precise sequence of cortical activity transforming sensory information into motor planning in mice trained to respond to a brief whisker stimulus by licking after a delay. We found that upon learning, the sensory information, initially highly-localized, rapidly spreads to diverse motor and higher-order areas, together with transient deactivation of orofacial regions, converging during the delay period to a focalized region of the frontal cortex. The secondary whisker motor cortex (wM2) appears as a key relay of this sensorimotor transformation, showing the earliest learning-enhanced response to the whisker stimulus. Our results suggest a specific cortical circuit with wM2 acquiring a pivotal role in transforming whisker information into preparatory activity for goal-directed motor planning.HighlightsCortex-wide, task-epoch specific causal neuronal dynamics of sensorimotor learningSensory information converges to a focal frontal region critical for delay-responseOrofacial cortex acquired an inhibitory response with delayed lick learningSecondary whisker motor cortex is a key node converting whisker input to lick plan