Rural households in developing countries depend on crops, forest extraction and other income sources for their livelihoods, but these livelihood contributions are sensitive to climate change. Combining socioeconomic data from about 8,000 smallholder households across the tropics with gridded precipitation and temperature data, we find that households have the highest crop income at 21°C temperature and 2,000 mm precipitation. Forest incomes increase on both sides of this agricultural maximum. We further find indications that crop income declines in response to weather shocks while forest income increases, suggesting that households may cope by reallocating inputs from agriculture to forests. Forest production may thus be less sensitive than crop production to climatic fluctuations, gaining comparative advantage in extreme climates and under weather anomalies. This suggests that well-managed forests might help poor rural households to cope with and adapt to future climate change.