Addictive substance use impairs cognitive flexibility, with unclear underlying mechanisms. The reinforcement of substance use is mediated by the striatal direct-pathway medium spiny neurons (dMSNs) that project to the substantia nigra pars reticulata (SNr). Cognitive flexibility is mediated by striatal cholinergic interneurons (CINs), which receive extensive striatal inhibition. Here, we hypothesized that increased dMSN activity induced by substance use inhibits CINs, reducing cognitive flexibility. We found that cocaine administration in rodents caused long-lasting potentiation of local inhibitory dMSN-to-CIN transmission and decreased CIN firing in the dorsomedial striatum (DMS), a brain region critical for cognitive flexibility. Moreover, chemogenetic and time-locked optogenetic inhibition of DMS CINs suppressed flexibility of goal-directed behavior in instrumental reversal learning tasks. Notably, rabies-mediated tracing and physiological studies showed that SNr-projecting dMSNs, which mediate reinforcement, sent axonal collaterals to inhibit DMS CINs, which mediate flexibility. Our findings demonstrate that the local inhibitory dMSN-to-CIN circuit mediates the reinforcement-induced deficits in cognitive flexibility.