Abstract The ability of consumers to adjust their diet in response to resource shifts is a key mechanism allowing the persistence of populations and underlying species' adaptive capacity. Yet on coral reefs, one of the marine habitats most vulnerable to global change, the extent to which species alter their diet and the consequences of dietary shifts for consumer performance and ecosystem functioning remain poorly understood. Here, we tested how dietary versatility can mediate the effects of habitat degradation on two invertivorous reef fishes— Chaetodon capistratus , a browser, and Hypoplectrus puella , an active predator—and whether diet shifts relate to variation in body condition and growth. We integrated DNA‐based gut content analyses (metabarcoding), otolith analysis, body condition and field surveys to link diet profiles to growth and relative body condition across reefs differing in coral cover. Metabarcoding revealed significant dietary variation in both species across reefs with different levels of coral cover. However, the response was more pronounced in the browser, whose diet was anthozoan‐dominated on healthier reefs, whereas it was annelid‐dominated on degraded reefs. We found significantly more variable body condition on degraded reefs in the browser, while the body condition of the active predator decreased in larger individuals on degraded reefs. Our results suggest that while dietary versatility serves as a mechanism to cope with degraded environments, the degree to which dietary shifts can buffer against the effects of habitat degradation varies between species. Overall, the variation in trophic niche across sites suggests that food webs and energy flow differ at relatively small scales between healthy and degraded reefs.