At the checkpoint
If your bag is packed tight, an officer may ask you to take food out so the X-ray image is clear.
Flying home from abroad
TSA’s answer covers screening at US airports. On the way home you go through the other airport’s screening first, and its rules are the ones that count there.
Coming home through US customs
USDA: “Most dried fruits and vegetables are not allowed into the United States without meeting special requirements to prevent the introduction of pests and diseases.”
USDA’s list of dried foods that are generally allowed names dates, figs and raisins, along with nuts, beans, peas, okra and Szechwan peppercorns. You still declare them and show them to CBP.
USDA says declared food brings no penalty, even when it’s refused. What happens if you don’t declare.
TSA puts this on every entry: “The final decision rests with the TSA officer on whether an item is allowed through the checkpoint.”