The high-luminosity pre-main sequence phase of M dwarfs may limit the habitability of their rocky planets by driving the loss of water in the atmosphere and desiccating the planet. However, water may remain in planetary interiors because high atmospheric surface pressures suppress water outgassing. If the atmospheric surface pressure decreases sufficiently, then the water in the interior will outgas, replenishing water in the atmosphere. This outgassed water may enable habitability after the habitable zone reaches the planet, raining out to form liquid oceans. However, if the planet has outgassed enough carbon dioxide to keep surface temperatures too high, then the outgassed water will not condense and the planet will not be habitable. We explore this process by adding a geochemical model to the VPLanet software package to self-consistently track water and carbon dioxide through a stagnant lid, including the effects of atmospheric escape, interior thermal evolution, stellar evolution, and tidal heating. We calibrate our model to reproduce Venus’ 92 bars of carbon dioxide and 30 ppm of water vapor in the atmosphere and the lack of a magnetic field. We then apply this validated model to calculate the coupled atmosphere-interior evolution on stagnant lid exoplanets with Earth-like compositions around TRAPPIST-1. We identify the parameter combinations that enable planets to protect water in their solid interiors until their atmospheres are sufficiently eroded for water outgassing to transition the planets from dry, Venus-like climates to habitable climates. We show that a planet’s habitability when it enters the habitable zone depends strongly on its initial carbon dioxide budget and the percentage of volcanism that is extrusive. We investigate TRAPPIST-1e’s potential habitability and demonstrate that it requires a carbon dioxide budget on the order of bars or an extrusive volcanism fraction of 0.001 to become habitable after the pre-main sequence phase (see attached image for detail). Our model shows that TRAPPIST-1e’s potential for habitability is limited.