Frontoparietal cortex is thought to be essential for flexible behavior, but the mechanism for control remains elusive. Here, we demonstrate a potentially critical property of this cortex: its dynamic configuration for coding of task-critical information. Using multivoxel pattern analysis of human functional imaging data, we demonstrate an adaptive change in the patterns of activation coding task-relevant stimulus distinctions. When task demands made perceptual information more difficult to discriminate, frontoparietal regions showed increased coding of this information. Visual cortices showed the opposite result: a weaker representation of perceptual information in line with the physical change in the stimulus.Ona longer timescale, a rebalancing of coding was also seen after practice, with a diminished representation of task rules as they became familiar. The results suggest a flexible neural system, exerting cognitive control in a wide range of tasks by adaptively representing the task features most challenging for successful goal-directed behavior.