After a major nuclear war, volcanic eruption or asteroid or comet impact that causes an abrupt sunlight reduction scenario, agricultural yields would plummet. We analyzed a nuclear winter scenario involving the injection of 150 Tg of soot in the stratosphere using a linear optimization model with and without global food trade. We investigated the effects of loss of global food trade, some simple adaptations like rationing and storage of excess food for the coldest years, and rapid, large-scale deployment of food sources which are less dependent on present day climate (so called resilient foods) including cool tolerant crops, methane single cell protein, lignocellulosic sugar, greenhouse crops, and seaweed. In the worst case of no global food trade and no adaptations, the model predicts a global famine. However, scaling up resilient foods quickly could mitigate this for many countries. Maintaining global food trade would further alleviate pressure on local food systems, unlocking the potential to feed the entire global population. However, insufficient preparation, post-disaster conflict, or economic collapse would worsen outcomes and hinder adaptation.