A critical challenge for ecologists is to understand the functional significance of habitat heterogeneity and connectivity for mobile animals. Here, we explore how a thermo-regulating fish responds to annual variation in the spatial patterning of thermal and trophic resources. In a third-order stream in coastal Alaska, juvenile coho salmon forage on sockeye salmon eggs at night in cold water and then move to warmer water to increase their digestive capacity. We mapped the spatial distributions of water temperature, juvenile coho salmon, and spawning sockeye salmon across a 5-year period during which summer discharge varied by greater than fivefold. In low flow years, warm water (9–12°C) was only available in thalweg (that is, main-channel) habitat at least approximately 400 m upstream of the cooler habitat (3–7°C) where sockeye salmon spawned. In high flow years, the entire stream thalweg was isothermal at 7–8°C, but inundated off-channel areas generated warm habitats (9–12°C) laterally adjacent to the downstream regions where sockeye salmon spawned. The daytime spatial distribution of juvenile coho salmon shifted from headwater thalweg habitats in low flow years, to downstream off-channel habitats in high flow years. In all years, the majority of juvenile coho salmon sampled during the daytime were found in warm habitat units without sockeye salmon present, yet they exhibited diet contents comprised virtually entirely of sockeye salmon eggs. Thus, thermoregulatory movements by coho salmon were able to track an annually shifting mosaic of water temperature. Our results demonstrate how the spatial habitat heterogeneity and connectivity of intact floodplains can in turn buffer aquatic organisms from high levels of temporal variation in habitat conditions and resource abundance.