In conventional intercalation cathodes, alkali metal ions can move in and out of a layered material with the charge being compensated for by reversible reduction and oxidation of the transition metal ions. If the cathode material used in a lithium-ion or sodium-ion battery is alkali-rich, this can increase the battery’s energy density by storing charge on the oxide and the transition metal ions, rather than on the transition metal alone1,2,3,4,5,6,7,8,9,10. There is a high voltage associated with oxidation of O2− during the first charge, but this is not recovered on discharge, resulting in reduced energy density11. Displacement of transition metal ions into the alkali metal layers has been proposed to explain the first-cycle voltage loss (hysteresis)9,12,13,14,15,16. By comparing two closely related intercalation cathodes, Na 0.75 [Li 0.25 Mn 0.75 ]O 2 and Na 0.6 [Li 0.2 Mn 0.8 ]O 2 , here we show that the first-cycle voltage hysteresis is determined by the superstructure in the cathode, specifically the local ordering of lithium and transition metal ions in the transition metal layers. The honeycomb superstructure of Na 0.75 [Li 0.25 Mn 0.75 ]O 2 , present in almost all oxygen-redox compounds, is lost on charging, driven in part by formation of molecular O 2 inside the solid. The O 2 molecules are cleaved on discharge, reforming O2−, but the manganese ions have migrated within the plane, changing the coordination around O2− and lowering the voltage on discharge. The ribbon superstructure in Na 0.6 [Li 0.2 Mn 0.8 ]O 2 inhibits manganese disorder and hence O 2 formation, suppressing hysteresis and promoting stable electron holes on O2− that are revealed by X-ray absorption spectroscopy. The results show that voltage hysteresis can be avoided in oxygen-redox cathodes by forming materials with a ribbon superstructure in the transition metal layers that suppresses migration of the transition metal.