Nutritional state often modulates olfaction and in Caenorhabditis elegans food stimulates aversive responses mediated by the nociceptive ASH sensory neurons. In the present study, we have characterized the role of key serotonergic neurons that differentially modulate aversive behavior in response to changing nutritional status. The serotonergic NSM and ADF neurons play antagonistic roles in food stimulation. NSM 5-HT activates SER-5 on the ASHs and SER-1 on the RIA interneurons and stimulates aversive responses, suggesting that food-dependent serotonergic stimulation involves local changes in 5-HT levels mediated by extrasynaptic 5-HT receptors. In contrast, ADF 5-HT activates SER-1 on the octopaminergic RIC interneurons to inhibit food-stimulation, suggesting neuron-specific stimulatory and inhibitory roles for SER-1 signaling. Both the NSMs and ADFs express INS-1, an insulin-like peptide, that appears to cell autonomously inhibit serotonergic signaling. Food also modulates directional decisions after reversal is complete, through the same serotonergic neurons and receptors involved in the initiation of reversal, and the decision to continue forward or change direction after reversal is dictated entirely by nutritional state. These results highlight the complexity of the "food signal" and serotonergic signaling in the modulation of sensory-mediated aversive behaviors.