We estimate the effects of temperature on human capital production in India. We show that high temperatures reduce both math and reading test scores through an agricultural income mechanism. The roll-out of a workfare program, by providing a safety net for the poor, substantially weakens the link between temperature and test scores. Our results imply that absent social protection programs, climate change will have large negative impacts on human capital production of poor populations in agrarian economies.