Seeking free volume around nanostructures for silicon-based anodes has been a crucial strategy to improve cycling and rate performance in the next generation Li-ion batteries. Herein, through a simple pyrolysis and in-situ polymerization approach, the low cost commercially available melamine foam as a soft template converts carbon nanotubes into highly dispersed and three-dimensionally interconnected framework with encapsulated silicon/polyaniline hierarchical nanoarchitecture. This unique core-sheath structure based on carbon nanotubes foam integrates a large number of mesoporous, thus providing well-accessible space for electrolyte wetting, whereas the carbon nanotubes matrix serves as conductive thoroughfares for electron transport. Meanwhile, the outer polyaniline coated on silicon nanoparticles provides effective space for volume expansion of silicon, further inhibiting the active material escape from the current collector. As expected, the PANI-Si@CNTs foam exhibits a high initial specific capacity of 1954 mAh g−1 and retains 727 mAh g−1 after 100 cycles at 100 mA g−1, which can be attributed to highly electrical conductivity of carbon nanotubes and protective layer of polyaniline sheath, together with three-dimensionally interconnected porous skeleton. This facile structure can pave a way for large scale synthesis of high durable silicon-based anodes or other electrode materials with huge volume expansion.