Designing lightweight polyimide (PI) foam with low density, high heat resistance, excellent electromagnetic interference (EMI) shielding ability and good compressibility is urgent in practical application of aeronautics and aerospace. However, to guarantee high EMI shielding effectiveness (EMI SE), high conductive filler content was always required, which would lead to high stiffness and poor compressibility of the composite foam, because of the agglomerations and the limitation of the interaction force between conductive filler and PI matrix. Herein, desirable CNT dispersion could be achieved with the assistant of the functional group on graphene oxide surface and the “π-π” conjugation between graphene and CNT. The resultant composite foam exhibits an average EMI SE of 28.2 dB and specific EMI SE (SSE) of 7050 dB cm2 g−1 at an only 0.02 g cm−3 density. Meanwhile, the multi-layer structure formed in cell wall and chemical bonding between PI matrix and graphene flakes endow the composite foam with good cycling compression stability. Moreover, the high decomposition temperature (Td, 10%) of 630.9 °C exhibits great competition with other previously reported PI-based composites. These features confirm the potential of the CNT/graphene/PI foam as a lightweight, compressive, heat-resistant material for efficient EMI shielding and electromagnetic wave absorption.