The use of energy-saving materials is an effective strategy for decreasing energy consumption and carbon emission. Wood is a type of biomass material with a natural hierarchical structure, which results in its high thermal insulation. It has been widely used in construction. However, developing wood-based materials without flammability and dimensional instability is still a challenge. Herein, we developed a wood/polyimide composite aerogel with a well-preserved hierarchical pore structure and dense hydrogen bonds inside, resulting in its excellent chemical compatibility and strong interfacial interactions between its two components. This novel wood-based composite was fabricated by removing most hemicellulose and lignin from natural wood, followed by the fast impregnation using an ‘in situ gel’ process. The introduction of polyimide into delignified wood substantially improved its mechanical properties, with the compression resistance being improved by over five times. Notably, the thermal conductivity coefficient of the developed composite was approximately half that of natural wood. Furthermore, the composite exhibited excellent fire-retardancy, hydrophobicity, thermal insulation, and mechanical properties. This study provides a novel method for wood modification, which not only aids interfacial compatibility between wood and polyimide but also retains the properties of the two components. The developed composite can effectively reduce energy consumption, making it promising for practical and complex thermal insulation applications.