This paper provides a spatial general equilibrium model to quantify the impact of climate change on the economy and migration. The model can capture the role of trade networks and agricultural suitability on the distribution of population and GDP accounting for endogenous adjustments of crop choice and trade. I use detailed geospatial data from 42 countries in sub-Saharan Africa (SSA) to simulate the impact of climate using forecasts of agricultural productivity in 2080 from FAO–GAEZ. Climate change is estimated to displace 12 percent of the SSA population and reduce real GDP by 4 percent. The capacity of switching crops, urbanizing, or trading goods reduces the impact of climate change in terms of population outflows. Finally, the adoption of modern inputs in agriculture reverses considerably the negative impacts of climate change.