Implantation of deep brain stimulation (DBS) electrodes via stereotactic neurosurgery has become a standard procedure for the treatment of Parkinson's disease. More recently, the range of neuropsychiatric conditions and the possible target structures suitable for DBS have greatly increased. The former include obsessive compulsive disease, depression, obesity, tremor, dystonia, Tourette's syndrome and cluster-headache. In this article we argue that several of the target structures for DBS (nucleus accumbens, posterior inferior hypothalamus, nucleus subthalamicus, nuclei in the thalamus, globus pallidus internus, nucleus pedunculopontinus) are located at strategic positions within brain circuits related to motivational behaviors, learning, and motor regulation. Recording from DBS electrodes either during the operation or post-operatively from externalized leads while the patient is performing cognitive tasks tapping the functions of the respective circuits provides a new window on the brain mechanisms underlying these functions. This is exemplified by a study of a patient suffering from obsessive-compulsive disease from whom we recorded in a flanker task designed to assess action monitoring processes while he received a DBS electrode in the right nucleus accumbens. Clear error-related modulations were obtained from the target structure, demonstrating a role of the nucleus accumbens in action monitoring. Based on recent conceptualizations of several different functional loops and on neuroimaging results we suggest further lines of research using this new window on brain functions.