Human-induced rapid environmental change (HIREC) disproportionately affects species with specialist traits and long generation times. By circumventing prolonged evolutionary processes, behavioural plasticity is critical in allowing species to cope with rapid environmental changes within their lifetimes. Coral reefs have faced multiple mass mortality events of corals related to climate change in the last two decades. The consequent loss of structural complexity adversely impacts long-lived, structure-dependent fish predators. We attempted to determine how well a guild of groupers (Pisces: Epinephelidae) copes with rapid structural change in the lightly fished Lakshadweep Archipelago, Indian Ocean. Of the 15 species, territorial and site-attached groupers declined exponentially with decreasing structural complexity, while widely ranging species showed no change. However, one site-attached species, the peacock grouper, Cephalopholis argus, maintained high densities across the structural gradient. We explored the mechanisms this species employs to cope with declining habitat structure. Our observations indicate that both a potential release from specialist competitors and plasticity in foraging behaviour (foraging territory size, diet and foraging mode) appeared to favour the peacock grouper’s survival in sites of high and low structure. While specialist competitors dropped out of the assemblage, the foraging territory size of peacock groupers increased exponentially with structural decline, but remained constant and compact (50 m2) above a threshold of structural complexity (corresponding to a canopy height of 60 cm). Interestingly, despite significant differences in prey density in sites of high and low structure, gut content and stable isotope analyses indicated that peacock groupers maintained a specialized dietary niche. In-water behavioural observations suggested that diet specialization was maintained by switching foraging modes from a structure-dependent ‘ambush’ to a structure-independent ‘widely foraging’ mode. The remarkable foraging plasticity of species such as the peacock grouper will become increasingly critical in separating winners from losers and may help preserve specialist ecosystem functions as habitats collapse as a result of climate change.