It is expected that as the Sun travels through the interstellar medium (ISM), there will be different filtration of Galactic Cosmic Rays (GCR) that affect Earth. The effect of GCR on Earth’s atmosphere and climate is still uncertain. Although the interaction with molecular clouds was previously considered, the terrestrial impact of compact cold clouds was neglected. There is overwhelming geological evidence from 60Fe and 244Pu isotopes that Earth was in direct contact with the ISM million years ago, and the local ISM is home to several nearby cold clouds. Here we show, with a state-of the art simulation that incorporate all the current knowledge about the heliosphere that if the solar system passed through a cloud such as Local Leo Cold Cloud, then the heliosphere which protects the solar system from interstellar particles, must have shrunk to a scale smaller than the Earth’s orbit around the Sun (0.22AU). Using a magnetohydrodynamic simulation that includes charge exchange between neutral atoms and ions, we show that during the heliosphere shrinkage, Earth was exposed to a neutral hydrogen density of up to 3000cm-3. This could have had drastic effects on Earth’s climate and potentially on human evolution at that time, as suggested by existing data.