The reversible function switching of the circadian clock protein KaiA is encoded in its structure.