We describe the in situ synthesis of the covalent organic framework-5 (COF-5) on the surfaces of carbon nanotubes (CNTs) and graphenes having homogeneous CNT@COF-5 core–shell structures using a sonochemical reaction in one pot. CNT@COF-5 was found to show better CO2 adsorption than the pristine COF-5.