Endogenous clocks regulate metabolism, physiology and behavior of most organisms in anticipation of daily swings in ambient light and temperature by synchronizing them to a ~24-h biochemical rhythm. However, the clock mechanism by which this rhythm is generated is not clear. Here, we will show in a model system that structural and dynamic gymnastics by proteins make the clock mechanism go round and round. The “gears” of the cyanobacterial clock are composed of only three proteins, KaiA, KaiB, and KaiC. Remarkably, when they are mixed together in a test tube with ATP, they generate a circadian rhythm of (auto)phosphorylation and (auto)dephosphorylation of the KaiC protein for several days. KaiA stimulates KaiC phosphorylation, whereas KaiB antagonizes KaiA to promote KaiC dephosphorylation. The mechanism regulating these protein interactions according to time of day is unknown. The field has been attempting to crack the mechanism using published crystal structures to model complexes of these proteins. However, we will show that protein motions and surprisingly large conformational changes (not captured in the crystal structures) completely determine when and how the KaiABC complexes assemble and disassemble, setting up critical time steps in the mechanism of the clock. Based on our new model of the cyanobacterial clock, we can also explain how the oscillator is entrained by environmental light/dark cycles, and how the clock transmits timing signals.