The thermosensory neuron AFD unexpectedly modulates locomotion based on tactile experience through molecular and circuit mechanisms distinct from those underlying thermosensation.