How the nervous system internally represents environmental food availability is poorly understood. Here, we show that quantitative information about food abundance is encoded by combinatorial neuron-specific gene-expression of conserved TGFβ and serotonin pathway components in Caenorhabditis elegans. Crosstalk and auto-regulation between these pathways alters the shape, dynamic range, and population variance of the gene-expression responses of daf-7 (TGFβ) and tph-1 (tryptophan hydroxylase) to food availability. These intricate regulatory features provide distinct mechanisms for TGFβ and serotonin signaling to tune the accuracy of this multineuron code: daf-7 primarily regulates gene-expression variability, while tph-1 primarily regulates the dynamic range of gene-expression responses. This code is functional because daf-7 and tph-1 mutations bidirectionally attenuate food level-dependent changes in lifespan. Our results reveal a neural code for food abundance and demonstrate that gene expression serves as an additional layer of information processing in the nervous system to control long-term physiology.