The balance between T helper type 1 (TH1) cells and other TH cells is critical for antiviral and anti-tumour responses1-3, but how this balance is achieved remains poorly understood. Here we dissected the dynamic regulation of TH1 cell differentiation during in vitro polarization, and during in vivo differentiation after acute viral infection. We identified regulators modulating T helper cell differentiation using a unique TH1-TH2 cell dichotomous culture system and systematically validated their regulatory functions through multiple in vitro and in vivo CRISPR screens. We found that RAMP3, a component of the receptor for the neuropeptide CGRP (calcitonin gene-related peptide), has a cell-intrinsic role in TH1 cell fate determination. Extracellular CGRP signalling through the receptor RAMP3-CALCRL restricted the differentiation of TH2 cells, but promoted TH1 cell differentiation through the activation of downstream cAMP response element-binding protein (CREB) and activating transcription factor 3 (ATF3). ATF3 promoted TH1 cell differentiation by inducing the expression of Stat1, a key regulator of TH1 cell differentiation. After viral infection, an interaction between CGRP produced by neurons and RAMP3 expressed on T cells enhanced the anti-viral IFNγ-producing TH1 and CD8+ T cell response, and timely control of acute viral infection. Our research identifies a neuroimmune circuit in which neurons participate in T cell fate determination by producing the neuropeptide CGRP during acute viral infection, which acts on RAMP3-expressing T cells to induce an effective anti-viral TH1 cell response.