The ecological impacts of predation risk are influenced by how prey allocate foraging effort across periods of safety and danger. Foraging decisions depend on current danger, but also on the larger temporal, spatial or energetic context in which prey manage their risks of predation and starvation. Using a rocky intertidal food chain, we examined the responses of starved and fed prey (Nucella lapillus dogwhelks) to different temporal patterns of risk from predatory crabs (Carcinus maenas). Prey foraging activity declined during periods of danger, but as dangerous periods became longer, prey state altered the magnitude of risk effects on prey foraging and growth, with likely consequences for community structure (trait-mediated indirect effects on basal resources, Mytilus edulis mussels), prey fitness and trophic energy transfer. Because risk is inherently variable over time and space, our results suggest that non-consumptive predator effects may be most pronounced in productive systems where prey can build energy reserves during periods of safety and then burn these reserves as 'trophic heat' during extended periods of danger. Understanding the interaction between behavioural (energy gain) and physiological (energy use) responses to risk may illuminate the context dependency of trait-mediated trophic cascades and help explain variation in food chain length.