The life histories of modular organisms are complicated, where selection and optimization can occur at both organismal and modular levels. At a modular level, growth, reproduction and death can occur in one module, independently of others. Across modular groups, there are no formal investigations of selection on module longevity. We used two field experiments to test whether selection acts on module longevity in a sessile marine invertebrate and whether selection varies across successional gradients and resource regimes. We found that selection does act on module longevity and that the strength of selection varies with environmental conditions. In environments where interspecific competition is high, selection favours colonies with longer zooid (module) longevity for colonies that initially received high levels of maternal investment. In environments where food availability is high and flow rate is low, selection also favours colonies with longer zooid longevity. These patterns of selection provide partial support for module longevity theory developed for plants. Nevertheless, that selection on module longevity is so context-dependent suggests that variation in module longevity is likely to be maintained in this system.