In this study, based on the preparation of hexaazatriphenylene-ternary-anhydride (HAT-T), polyimide membranes were prepared by reaction of 4,4′-(hexafluoroisopropylidene)diphthalic anhydride (6FDA), 4,4′-diaminodiphenyl sulfide (SDA), 2,2′-bis (trifluoromethyl)diaminobiphenyl (TFDB) and 5-amino-2-(4-aminophenyl) benzimidazole (PABZ). Polyimide films with a hexazobenzo structure have good film-forming properties, high molecular weight (Mn = 0.79–11.79 × 106, Mw = 1.03–16.60 × 106) and narrow molecular weight distribution (polymer dispersity index = 1.17–1.54). With the introduction of rigid HAT-T, the tensile strength and elongation at break of polyimide films are 195.63–510.37 MPa and 4.00–9.70%, respectively, with excellent mechanical properties. The gas separation performance test shows that hexaazatriphenylene-containing polyimide films have good gas selectivity for CO2/CH4. In particular, the separation performance of PIc-t (6FDA/PABZ/HAT-T) surpasses the “2008 Robeson Upper Bound”. The selectivity of 188.43 for CO2/CH4 gas reveals its potential value in the separation and purification of methane gas.