a, Illustration of four action types analyzed in (b) and (c): initiation of movement from left lever (LL) to food magazine (M), from M to LL, from right lever (RL) to M, from M to RL. b, c, GCAMP3 fluorescence in direct- and indirect-pathway SPNs measured in the left striatum, aligned to initiation of the corresponding actions illustrated in (a). Top row: multiple trials showing color-coded GCAMP3 fluorescence and average response from a single D1-Cre (b) and A2A-Cre (c) mouse. Bottom row: averaged responses from 3 D1-Cre (b) and 4 A2A-Cre mice (c). *P<0.05, paired-comparison between baseline and GCAMP3 peak. d, g, multiple trials of GCAMP3 fluorescence and average response aligned to the threshold of each detected fluorescence transient from a single mouse. The two boxes indicate ‘Pre’ and ‘Post’ time windows analyzed in panels (e), (f), (h), and (i). e, h, Probability analysis of different types of locomotor activities before and after onset of fluorescence transients in direct- (e) and indirect-pathway (h) SPNs in left striatum. Interaction between action states and Pre/Post, Direct-pathway F4,10=233, P<0.001; indirect-pathway F4,10=39.4, P<0.001; Posthocs, *P<0.05, **P<0.01, ***P<0.001. f, i, Probability analysis of two categories of locomotor activity based on whether a rightward movement was made within the defined time window. Right move- was pooled from ‘inactive’, ‘left turn’ and ‘straight’ in (e) and (h). Right move+ was pooled from ‘right turn’ and ‘complex’ in (e) and (h). N = 3 for D1-Cre, N = 4 for A2A-Cre mice. Error bars represent ±S.E.M.