To survive, animals must continually decide whether to persevere with their current goal, switch to a new one or disengage altogether. Three genetically defined types of neuronal cell in a small midbrain area called the median raphe nucleus are shown to control decisions about whether to persevere, explore or disengage.