“Everyday function demands efficient and flexible decision-making that allows for habitual and goal-directed action control. An inability to shift has been implicated in disorders with impaired decision-making, including obsessive-compulsive disorder and addiction. Despite this, our understanding of the specific molecular mechanisms and circuitry involved in shifting action control remains limited. Here we identify an endogenous molecular mechanism in a specific cortical-striatal pathway that mediates the transition between goal-directed and habitual action strategies. Deletion of cannabinoid type 1 (CB1) receptors from cortical projections originating in the orbital frontal cortex (OFC) prevents mice from shifting from goal-directed to habitual instrumental lever pressing. Activity of OFC neurons projecting to dorsal striatum (OFC-DS) and, specifically, activity of OFC-DS terminals is necessary for goal-directed action control. Lastly, CB1 deletion from OFC-DS neurons prevents the shift from goal-directed to habitual action control. These data suggest that the emergence of habits depends on endocannabinoid-mediated attenuation of a competing circuit controlling goal-directed behaviors.”