Cognitive flexibility is a crucial human ability allowing efficient adaptation to changing task challenges. Although a person's degree of flexibility can vary from moment to moment, the conditions regulating such fluctuations are not well understood. Using a task-switching procedure with fMRI, we found several brain regions in which neural activity preceding each trial predicted subsequent cognitive flexibility. Specifically, as pretrial activity increased, performance improved on trials when the task switched but did not improve when the task repeated. Regions from which flexibility could be predicted reliably included the basal ganglia, anterior cingulate cortex, prefrontal cortex, and posterior parietal cortex. Although further analysis revealed similarities across the regions in how flexibility was predicted, results supported the existence of multiple independent sources of prediction. These results reveal distinct neural mechanisms underlying fluctuations in cognitive flexibility.basal ganglia ͉ fMRI ͉ task switching ͉ cognitive control J uggling several tasks at once, or multitasking, is a fact of everyday life and becomes increasingly salient with the growing use of products such as mobile telephones, wireless e-mail devices, and portable music players. Given the wide array of tasks people successfully pack into their daily routines, the capacity to multitask is among the most remarkable endowments of the human mind. Nevertheless, this capacity, known as ''cognitive flexibility,'' does come at a cost: empirical investigations of task switching consistently show that performance upon switching to a new task is slower and more error prone than performance when repeating a task (1-3). These behavioral costs are difficult to avoid even when subjects are given ample time to prepare for the upcoming task (1, 3), but variations in the size of this switch cost have been observed within experimental sessions (4, 5), suggesting that an individual's flexibility can fluctuate from moment to moment.Unfortunately, it is unclear how fluctuations in flexibility can be predicted, although such knowledge would carry considerable value. From a practical standpoint, for instance, productivity could be maximized by reserving multitasking activities for known periods of high flexibility and scheduling single-task activities for periods of low flexibility. From a theoretical standpoint, identifying the predictors of cognitive flexibility could facilitate a deeper understanding of the mechanisms governing cognitive control.In this study, we used fMRI to predict cognitive flexibility. Because fMRI is noninvasive and imposes minimal additional task demands on subjects, it potentially can reveal variations in flexibility with negligible interference to the task-switching procedure.Our particular aim was to learn if brain activity preceding task cues could predict task-switching performance. Probing before the cue, when the task to be performed has not yet been revealed to subjects, distinguishes our work from previous studies that...