For global catastrophic risks the costs of food storage become impractical for most of the population  and for some such catastrophes conventional agriculture would not function due to the loss of a large fraction of sunlight (e.g. during nuclear winter or a supervolcano). In such situations, alternative food is necessary, which is converting natural gas and wood fiber to human edible food.
To me, the best option is to store emergency food. How much? If you have none, store enough for a few days. If you have enough for a few days, get enough for a week. How much you store depends on what time frame you think you're at risk for having to be completely independent. The early settlers of the southwest liked to store enough food for a whole year and still do to this day!