Motor sequences are formed through the serial execution of different movements, but how nervous systems implement this process remains largely unknown. We determined the organizational principles governing how dirty fruit flies groom their bodies with sequential movements. Using genetically targeted activation of neural subsets, we drove distinct motor programs that clean individual body parts. This enabled competition experiments revealing that the motor programs are organized into a suppression hierarchy; motor programs that occur first suppress those that occur later. Cleaning one body part reduces the sensory drive to its motor program, which relieves suppression of the next movement, allowing the grooming sequence to progress down the hierarchy. A model featuring independently evoked cleaning movements activated in parallel, but selected serially through hierarchical suppression, was successful in reproducing the grooming sequence. This provides the first example of an innate motor sequence implemented by the prevailing model for generating human action sequences. DOI: http://dx.doi.org/10.7554/eLife.02951.001, eLife digest Anyone who has ever lived with a cat is familiar with its grooming behavior. This innate behavior follows a particular sequence as the cat methodically cleans its body parts one-by-one. Many animals also have grooming habits, even insects such as fruit flies. The fact that grooming sequences are seen across such different species suggests that this behavior is important for survival. Nevertheless, how the brain organizes grooming sequences, or other behaviors that involve a sequence of tasks, is not well understood. Fruit flies make a good model for studying grooming behavior for a couple of reasons. First, they are fastidious cleaners. When coated with dust they will faithfully carry out a series of cleaning tasks to clean each body part. Second, there are many genetic tools and techniques that researchers can use to manipulate the fruit flies' behaviors. One technique allows specific brain cells to be targeted and activated to trigger particular behaviors. Seeds et al. used these sophisticated techniques, computer modeling, and behavioral observations to uncover how the brains of fruit flies orchestrate a grooming sequence. Dust-covered flies follow a predictable sequence of cleaning tasks: beginning by using their front legs to clean their eyes, they then clean their antennae and head. This likely helps to protect their sensory organs. Next, they move on to the abdomen, possibly to ensure that dust doesn't interfere with their ability to breathe. Wings and thorax follow last. Periodically, the flies stop to rub their legs together to remove any accumulated dust before resuming the cleaning sequence. Seeds et al. activated different sets of brain cells one-by-one to see if they could trigger a particular grooming task and found that individual cleaning tasks could be triggered, in the absence of dust, by stimulating a specific group of brain cells. This suggests each cleaning task is a discrete behavior controlled by a subset of cells. Then Seeds et al. tried to stimulate more than one cleaning behavior at a time; they discovered that wing-cleaning suppressed thorax-cleaning, abdomen-cleaning suppressed both of these, and head-cleaning suppressed all the others. This suggests that a ‘hierarchy’ exists in the brain that exactly matches the sequence that flies normally follow as they clean their body parts. By learning more about how the brain coordinates grooming sequences, the findings of Seeds et al. may also provide insights into other behaviors that involve a sequence of tasks, such as nest building in animals or typing in humans. Following on from this work, one of the next challenges will be to see if such behaviors also use a ‘suppression hierarchy’ to ensure that individual tasks are carried out in the right order. DOI: http://dx.doi.org/10.7554/eLife.02951.002