Overarching themes in the terminal differentiation of the enteric nervous system, an autonomously acting unit of animal nervous systems, have so far eluded discovery. We describe here the overall regulatory logic of enteric nervous system differentiation of the nematode C. elegans that resides within the foregut (pharynx) of the worm. A Caenorhabditis elegans homolog of the Drosophila Sine Oculis homeobox gene, ceh-34, is expressed in all 14 classes of interconnected pharyngeal neurons from their birth throughout their life time, but in no other neuron type of the entire animal. Constitutive and temporally controlled ceh-34 removal shows that ceh-34 is required to initiate and maintain the neuron type-specific terminal differentiation program of all pharyngeal neuron classes, including their circuit assembly, without affecting panneuronal features. Through additional genetic loss of function analysis, we show that within each pharyngeal neuron class, ceh-34 cooperates with different homeodomain transcription factors to individuate distinct pharyngeal neuron classes. Our analysis underscores the critical role of homeobox genes in neuronal identity specification and links them to the control of neuronal circuit assembly of the enteric nervous system. Together with the pharyngeal nervous system simplicity as well as its specification by a Sine Oculis homolog, our findings invite speculations about the early evolution of nervous systems.