Coral reefs are among the many communities believed to exhibit regime shifts between alternative stable states, single-species dominance, and coexistence. Proposed drivers of regime shifts include changes in grazing, spatial clustering, and ocean temperature. Here, we distill the dynamic regimes of coral-macroalgal interaction into a three-dimensional geometry based on stability, akin to thermodynamic phase diagrams of state transitions, to facilitate analysis. Specific regime-shifting forces can be understood as trajectories through the cubic regime geometry. This geometric perspective allows us to understand multiple forces simultaneously in terms of the stability and persistence of interacting species. For example, in a coral-macroalgal community, grazing on macroalgae leads to alternative stable states when there is no spatial clustering (e.g., high habitat connectivity), while warming decreases coexistence. However, with spatial clustering, grazing promotes coexistence because of elevated local intraspecific competition. The geometry of regime shifts provides a general framework to analyze two-species communities and can help conservation efforts navigate complexity and abrupt environmental changes.