Locomotion is continuously regulated by an animal's position within an environment relative to goals. Direct and indirect pathway striatal output neurons (dSPNs and iSPNs) influence locomotion, but how their activity is naturally coordinated by changing environments is unknown. We found, in head-fixed mice, that the relative balance of dSPN and iSPN activity was dynamically modulated with respect to position within a visually-guided locomotor trajectory to retrieve reward. Imbalances were present within ensembles of position-tuned SPNs which were sensitive to the visual environment. Our results suggest a model in which competitive imbalances in striatal output are created by learned associations with sensory input to shape context dependent locomotion.