We report a numerical investigation on the catalytic growth mechanism of a single-walled carbon nanotube (SWNT) inside a template SWNT, that is, formation of a double-walled carbon nanotube (DWNT). The molecular dynamics simulations together with complementary ab inito calculations suggest that the DWNT formation from thermally annealed metallocene-encapsulating SWNT goes through formation of metal catalyst cluster, followed by SWNT precipitation at the root. The diameter of the inner SWNT is determined by the carbon/metal layered structure of the catalyst cluster, which gives rise to a DWNT interlayer distance significantly different from the van der Waals distance.