We are interested in how skills are learned and consolidated in the brain. We approach this problem using a brain-machine interface (BMI) learning paradigm. In addition to holding great therapeutic potential as assistive and rehabilitation technology, BMIs provide also a powerful framework for examining basic neuroscience questions, especially those related to the neural correlates of learning behavior, allowing to directly control the causal relationship between neuronal activity and behavioral output. In this talk I will present recent experimental and computational work from our laboratory addressing the following questions: How do task-relevant neural populations coordinate during activity exploration and consolidation? How can the brain select activity patterns to consolidate? Do the mechanisms of neural activity pattern consolidation generalize across the neocortex?