For example growing food within the walls
Constantly. Digging wells. Adding paths which smugglers might bring supplies. Making sure there is room for live stock to slaughter during a siege. Having gardens. The simple problem of logistics though is that there's not a lot of room, and food needs room to grow, and could be very many mouths to feed.