An MIT team has produced an atlas of how most cells, and the circuits they take part in, encode a worm's actions. The atlas reveals the underlying “logic” of how an animal brain produces a sophisticated and flexible repertoire of behaviors, even as its environmental circumstances change.