Much of the world's biodiversity is held within tropical rainforests, which are increasingly fragmented by agricultural practices. In these threatened landscapes, there are many organisms that acquire chemical defenses from their diet and are therefore intimately connected with their local food webs. Poison frogs (Family Dendrobatidae) are one such example, as they acquire alkaloid-based chemical defenses from their diet of leaf litter ants and mites. It is currently unknown how habitat fragmentation impacts chemical defense across trophic levels, from arthropods to frogs. We examined the chemical defenses and diet of the Diablito poison frog (Oophaga sylvatica), and the diversity of their leaf litter ant communities in secondary forest and reclaimed cattle pasture. Notably, this research was performed in collaboration with two high school science classrooms. We found that the leaf litter of forest and pasture frog habitats differed significantly in ant community structure. We also found that forest and pasture frogs differed significantly in diet and alkaloid profiles, where forest frogs contained more of specific alkaloids and ate more ants in both number and volume. Finally, ant species composition of frog diets resembled the surrounding leaf litter, but diets were less variable. This suggests that frogs tend to consume particular ant species within each habitat. To better understand how ants contribute to the alkaloid chemical profiles of frogs, we chemically profiled several ant species and found some alkaloids to be common across many ant species while others are restricted to a few species. At least one alkaloid (223H) found in ants from disturbed sites was also found in skins from pasture frogs. Our experiments are the first to link anthropogenic land use changes to dendrobatid poison frog chemical defenses through variation in leaf litter communities, which has implications for conservation management of these threatened amphibians.