Maintaining or shifting between behavioral states according to context is essential for animals to implement fitness-promoting strategies. How the integration of internal state, past experience and sensory inputs orchestrates persistent multidimensional behavioral changes remains poorly understood. Here, we show thatC. elegansintegrates environmental temperature and food availability over different timescales to engage in persistent dwelling, scanning, global or glocal search strategies matching thermoregulatory and feeding needs. Transition between states, in each case, involves regulating multiple processes including AFD or FLP tonic sensory neurons activity, neuropeptide expression and downstream circuit responsiveness. State-specific FLP-6 or FLP-5 neuropeptide signaling acts on a distributed set of inhibitory GPCR(s) to promote scanning or glocal search, respectively, bypassing dopamine and glutamate-dependent behavioral state control. Integration of multimodal context via multisite regulation in sensory circuits might represent a conserved regulatory logic for a flexible prioritization on the valence of multiple inputs when operating persistent behavioral state transitions.