The influence of size-selective oviposition behaviour by parasitoids on the evolution of life-history timing in their hosts was examined using an optimization model of a two-stage life history similar to a genetic algorithm. Host populations with varying durations of early-larval development were subjected to selection in scenarios where parasitoids had fixed preferences for oviposition on late-stage larvae, or those where parasitoid attack was dependent on the relative frequencies of the two life stages present in the population. Fixed preference for oviposition on late-stage larvae caused positive directional selection on the duration of early-larval development. Surviving individuals remained for as long as possible in the first stage of development in order to avoid parasitoid attack. Frequency-dependent parasitoid attack, in contrast, caused maintenance of variation in the duration of early-larval development. The influence of the fitness payoffs of different life stages on the plasticity of size-selective oviposition behaviour is discussed, as are possible implications of the model results for parasitoid-host population dynamics.