Diamond is an ideal material for a broad range of current and emerging applications in tribology, quantum photonics, high-power electronics, and sensing. However, top-down processing is very challenging due to its extreme chemical and physical properties. Gas-mediated electron beam-induced etching (EBIE) has recently emerged as a minimally invasive, facile means to dry etch and pattern diamond at the nanoscale using oxidizing precursor gases such as O and HO. Here we explain the roles of oxygen and hydrogen in the etch process and show that oxygen gives rise to rapid, isotropic etching, while the addition of hydrogen gives rise to anisotropic etching and the formation of topographic surface patterns. We identify the etch reaction pathways and show that the anisotropy is caused by preferential passivation of specific crystal planes. The anisotropy can be controlled by the partial pressure of hydrogen and by using a remote RF plasma source to radicalize the precursor gas. It can be used to manipulate the geometries of topographic surface patterns as well as nano- and microstructures fabricated by EBIE. Our findings constitute a comprehensive explanation of the anisotropic etch process and advance present understanding of electron-surface interactions.