Whole-cell patch-clamp electrophysiology of neurons is a gold-standard technique for high-fidelity analysis of the biophysical mechanisms of neural computation and pathology, but it requires great skill to perform. We have developed a robot that automatically performs patch clamping in vivo, algorithmically detecting cells by analyzing the temporal sequence of electrode impedance changes. We demonstrate good yield, throughput and quality of automated intracellular recording in mouse cortex and hippocampus.