The exoskeleton of arthropods forms an efficient protection against pathogens, but this first line of defence is periodically weakened during ecdysis, increasing the opportunity for surrounding pathogens to invade the body cavity. Since the richness of pathogens in the environment can be spatially and temporally variable, arthropods may have a fitness advantage in moulting in a place and time of low infection risk. Consistent with this hypothesis, we found that the amphipod crustacean, Gammarus pulex, exhibits temporal adjustment of the moult cycle in response to elevated risks of infection. Interestingly, this phenomenon is variable between two populations and independent of levels of immune defences. These results suggest that plasticity of the moult cycle in response to elevated risks of infection is adaptive and may result from adaptation to local variations in the risk of infection.