Shifting between goal-directed and habitual actions allows for efficient and flexible decision making. Here we demonstrate a novel, within-subject instrumental lever-pressing paradigm, in which mice shift between goal-directed and habitual actions. We identify a role for orbitofrontal cortex (OFC) in actions following outcome revaluation, and confirm that dorsal medial (DMS) and lateral striatum (DLS) mediate different action strategies. Simultaneous in vivo recordings of OFC, DMS and DLS neuronal ensembles during shifting reveal that the same neurons display different activities depending on whether presses are goal-directed or habitual, with DMS and OFC becoming more and DLS less engaged during goal-directed actions. Importantly, the magnitude of neural activity changes in OFC following changes in outcome value positively correlates with the level of goal-directed behavior. Chemogenetic inhibition of OFC disrupts goal-directed actions, whereas optogenetic activation of OFC specifically increases goal-directed pressing. These results also reveal a role for OFC in action revaluation, which has implications for understanding compulsive behavior.