Abstract Movements are measurable outputs of the nervous system and simple movements can be combined to compose complicated behaviors. We use limb tracking and connectome analyses to map the neural circuits controlling the elemental leg movements in Drosophila grooming. The organization of the pre-motor networks for this innate, sequential behavior will show a successful solution for a complex motor control problem and reveal generalizable connectivity motifs whose computational functions can be experimentally tested. Starting from a detailed understanding of the temporal patterns in this behavior, we will identify the simplest movement subroutines that can be combined to assemble the whole repertoire. The circuits that produce these movements lie between the command-like neurons that initiate them and subsets of motor neurons that execute them. Using the results of our genetic screens for command neurons and new electron microscopy data for the Drosophila ventral nerve cord, we will trace neuronal connections to uncover the complete pre-motor network, showing which groups of muscles are bound to work together by common excitatory and inhibitory connections to their associated motor neurons. The pre-motor connectome allows us to test possible circuit functions through modeling. We will investigate whether command neurons that induce grooming sequences with shared movements converge onto common pre-motor nodes or maintain independent control pathways. By mapping inhibitory connections, we will determine whether these add flexibility to efficiently modify aspects of elemental movements: for example, if leg extension is a building block, it could be directed toward the head for a sweep or toward the contralateral leg for a rub by adding and subtracting a few additional motor neurons targeting more proximal elevator muscles. The anatomical connectome for pre-motor circuits constrains hypotheses about circuit function, leads to unexpected discoveries of highly connected nodes, and guides future experiments to measure neuronal activity and behavioral consequences.