The brain is a site of relative immune privilege. Although CD4 T cells have been reported in the central nervous system, their presence in the healthy brain remains controversial, and their function remains largely unknown. We used a combination of imaging, single cell, and surgical approaches to identify a CD69+ CD4 T cell population in both the mouse and human brain, distinct from circulating CD4 T cells. The brain-resident population was derived through in situ differentiation from activated circulatory cells and was shaped by self-antigen and the peripheral microbiome. Single-cell sequencing revealed that in the absence of murine CD4 T cells, resident microglia remained suspended between the fetal and adult states. This maturation defect resulted in excess immature neuronal synapses and behavioral abnormalities. These results illuminate a role for CD4 T cells in brain development and a potential interconnected dynamic between the evolution of the immunological and neurological systems. VIDEO ABSTRACT.