The polychaete worm Serpula vermicularis (Serpulidae) filter feeds at the mouth of its calcareous tube, but retreats into the tube when started by mechanical stimuli likely to be associated with predators. While in its tube, a worm is safe but cannot feed. Thus. hiding has a lost-opportunity cost. We show that this cost can be substantial, given that food in the natural habitat appears in pulses, and good feeding conditions may not last long or recur frequently. We expect that a worm's hiding time will be sensitive to the lost-opportunity cost, and we present data ft-om a series of experiments that support this prediction. The worms seem able to track relatively short-term changes in food availability, and some evidence suggests that they assess food availability on a relative basis, comparing current feeding conditions to those recently experienced. Hiding and other types of cryptic behavior are common antipredator tactical and animals may commonly adjust the durations of such behaviors to current benefits and costs (including lost opportunity), as they perceive them.