In response to parasite exposure, organisms from a variety of taxa undergo a shift in reproductive investment that may trade off with other life-history traits including survival and immunity. By suppressing reproduction in favour of somatic and immunological maintenance, hosts can enhance the probability of survival and recovery from infection. By plastically enhancing reproduction through terminal investment, on the other hand, hosts under the threat of disease-induced mortality could enhance their lifetime reproductive fitness through reproduction rather than survival. However, we know little about the evolution of these strategies, particularly when hosts can recover and even bequeath protection to their offspring. In this study, we develop a stochastic agent-based model that competes somatic maintenance and terminal investment strategies as they trade off differentially with lifespan, parasite resistance, recovery and transgenerational immune priming. Our results suggest that a trade-off between reproduction and recovery can drive directional selection for either terminal investment or somatic maintenance, depending on the cost of reproduction to lifespan. However, some conditions, such as low virulence with a high cost of reproduction to lifespan, can favour diversifying selection for the coexistence of both strategies. The introduction of transgenerational priming into the model favours terminal investment when all strategies are equally likely to produce primed offspring, but favours somatic maintenance if it confers even a slight priming advantage over terminal investment. Our results suggest that both immune priming and recovery may modulate the evolution of reproductive shift diversity and magnitude upon exposure to parasites.