Millions of smallholder farmers in low-income countries are highly vulnerable to food-supply shocks, and reducing this vulnerability remains challenging in view of climatic changes. Restrictions to limit the spread of the COVID-19 pandemic produced a severe supply-side shock in rural areas of Sub-Saharan Africa, including through frictions in agricultural markets. We use a large-scale field experiment to examine the effects of improved on-farm storage on household food security during COVID-19 restrictions. Based on text message survey data we find that the prevalence of food insecurity increased in control group households during COVID-19 restrictions (coinciding with the agricultural lean season). In treatment households, equipped with an improved on-farm storage technology and training in its use, food insecurity was lower during COVID-19 restrictions. This underscores the benefits of improved on-farm storage for mitigating vulnerability to food-supply shocks. These insights are relevant for the larger, long-term question of climate change adaptation, and also regarding trade-offs between public health protection and food security.