Through environmentally induced maternal effects females may fine-tune their offspring's phenotype to the conditions offspring will encounter after birth. If juvenile and adult ecologies differ, the conditions that mothers experienced as juveniles may better predict their offspring's environment than the adult females' ambient conditions. Maternal effects induced by the environment experienced by females during their early ontogeny should evolve when three ecological conditions are met: (i) Adult ecology does not predict the postnatal environmental conditions of offspring; (ii) Environmental conditions for juveniles are correlated across successive generations; and (iii) Juveniles occasionally settle in conditions that differ from the juvenile habitat of their mothers. By combining size-structured population counts, ecological surveys and a genetic analysis of population structure we provide evidence that all three conditions hold for Simochromis pleurospilus, a cichlid fish in which mothers adjust offspring quality to their own juvenile ecology. Adults of many species cannot predict offspring's environment from ambient cues. Hence we predict that life-stage specific maternal effects are common in animals. Therefore, it is important to incorporate parental ontogeny in the study of parental effects when juveniles and adults inhabit different environments.