  We perform the maximal twist of eleven-dimensional supergravity. This twist
is partially topological and exists on manifolds of $G_2 \times SU(2)$
holonomy. Our derivation starts with an explicit description of the
Batalin-Vilkovisky complex associated to the three-form multiplet in the pure
spinor superfield formalism. We then determine the $L_\infty$ module structure
of the supersymmetry algebra on the component fields. We twist the theory by
modifying the differential of the Batalin-Vilkovisky complex to incorporate the
action of a scalar supercharge. We find that the resulting free twisted theory
is given by the tensor product of the de Rham and Dolbeault complexes of the
respective $G_2$ and $SU(2)$ holonomy manifolds as conjectured by Costello.
