Animals adjust their behavioral priorities according to momentary needs and prior experience. We show that Caenorhabditis elegans changes how it processes sensory information according to the oxygen environment it experienced recently. C. elegans acclimated to 7% O 2 are aroused by CO 2 and repelled by pheromones that attract animals acclimated to 21% O 2 . This behavioral plasticity arises from prolonged activity differences in a circuit that continuously signals O 2 levels. A sustained change in the activity of O 2 -sensing neurons reprograms the properties of their postsynaptic partners, the RMG hub interneurons. RMG is gap-junctionally coupled to the ASK and ADL pheromone sensors that respectively drive pheromone attraction and repulsion. Prior O 2 experience has opposite effects on the pheromone responsiveness of these neurons. These circuit changes provide a physiological correlate of altered pheromone valence. Our results suggest C. elegans stores a memory of recent O 2 experience in the RMG circuit and illustrate how a circuit is flexibly sculpted to guide behavioral decisions in a context-dependent manner.neural circuit | experience-dependent plasticity | tonic circuit | oxygen sensing | acclimation T he body comprises multiple highly integrated subsystems working together to sustain life from moment to moment and over long time scales (1). Much of this coordination involves dynamically interacting neural circuits that optimize responses to current circumstances by taking into account sensory input, organismal state, and previous experience (2-8). Circuit cross-talk enables animals to adjust their behavioral priorities to changing environments, e.g., variation in temperature, humidity, day length, or oxygen (O 2 ) levels (9-13). Whereas some behavioral adjustments can be rapid (14, 15), others develop over time, as animals adapt to changed conditions. How animals store information about their recent environment, and use this information to modify behavioral choices, is poorly understood.The compact nervous system of Caenorhabditis elegans, which comprises only 302 uniquely identifiable neurons (wormwiring.org) (16), provides an opportunity to study the links between prior environmental experience, circuit plasticity, and behavioral change. This nematode is adapted to a life feeding on bacteria in rotting fruit (17). It has sensory receptors for odors, tastants, pheromones, and respiratory gases, as well as temperature, mechanical, and noxious cues (18-21). Despite this simplicity, the mechanisms by which its nervous system marshals information about past and present sensory experience to shape behavioral priorities remain largely mysterious. The anatomical connectome, while valuable (22), is insufficient to explain or predict neuronal network function (23, 24), partly because neuromodulators can dynamically reconfigure and specify functional circuits (25-27).When ambient O 2 approaches 21%, C. elegans wild isolates become persistently aroused and burrow to escape the surface (28)(29)(30). This state swi...