The main key with food is **you have to declare every little bit of it**.
Some foods are generally no go's: fresh fruit (especially citrus products, but also others) being the main one. Meats are another issue -- certain types of meat are not allowed to enter the US. dairy can be another issue.
Many commerically packaged prepared foods will likely be ok *if declared*. so something like granola bars or protein bars or fruit-roll-ups.
I have brought fresh a fresh Swiss Chalet quarter chicken dinner with me through US pre-clearance. After the CBP officer joked that he might have to seize it because he had not had dinner yet, he let me through with it but made me promise it would all be eaten and disposed of before I landed in the US. For fresh food like that I would say it is much better to just buy it after Customs, though that is not always an option at all airports (e.g. in Ottawa there are very few food options on the US side).
US CBP has excellent info on their website about importing foods (since that is what you are doing -- when you go through US Customs pre-clearance you are technically entering the US even though you are still in a Canadian airport). note that for some foods there are special rules that apply to Canada -- both in terms of banning some things as well as allowing things that are a product of Canada while the same food item from the rest of the world is banned.
Because I have multiple food allergies, eating in an airport is extremely difficult (and sometimes impossible) and eating airplane food is not an option. So I have to bring my own food when I am going to be traveling -- even a short flight can get diverted or delayed ending in a multi-hour trip. My current solution is to bring a couple backpacking/hiking meals (freeze dried/dehydrated... all I need to do is add hot water, which I can get usually for free from a place that serves tea, like a Timmies).
I contacted CBP to ask what was and was not allowed; I explained the food I intended to bring, brand, specific product, noted that it is made in the USA and has a US Dept of Agriculture inspection logo on the package; and I buy it in Canada or the USA and **bring the receipt with me** (though have never had to show it). CBP was very responsive and provided me with lots of info and answered my questions. I followed up by phone with a question, too. Again, great customer service.
You can get their email address and phone number for questions from their website.
SW