We present several different codes and protocols to distillT, controlled-S, and Toffoli (orCCZ) gates. One construction is based on codes that generalize the triorthogonal codes, allowing any of these gates to be induced at the logical level by transversalT. We present a randomized construction of generalized triorthogonal codes obtaining an asymptotic distillation efficiencyγ→1. We also present a Reed-Muller based construction of these codes which obtains a worseγbut performs well at small sizes. Additionally, we present protocols based on checking the stabilizers ofCCZmagic states at the logical level by transversal gates applied to codes; these protocols generalize the protocols of. Several examples, including a Reed-Muller code forT-to-Toffoli distillation, punctured Reed-Muller codes forT-gate distillation, and some of the check based protocols, require a lower ratio of input gates to output gates than other known protocols at the given order of error correction for the given code size. In particular, we find a512T-gate to10Toffoli gate code with distance8as well as triorthogonal codes with parameters[[887,137,5]],[[912,112,6]],[[937,87,7]]with very low prefactors in front of the leading order error terms in those codes.