Within an individual, the population of mature naive T cells is maintained throughout life by both input from the thymus and homeostatic proliferation in the periphery. Here, we develop a mathematical model of this process of naive T-cell homeostasis, and use it to explore questions of lifespan, inheritance and receptor repertoire during ageing. By assuming lifespan is largely determined by a heritable trait reset on mitosis, we show that homeostatic proliferation leads naturally to a longer lived population with age. A plausible candidate for the heritable trait influencing lifespan is T-cell receptor affinity for major histocompatibility molecules loaded with self-peptides. Concurrently with increasing lifespan, receptor diversity decreases with age, thus quantitatively linking these two phenomena. These results depend on the thymus involuting with age so that homeostatic proliferation becomes the dominant mode of replacement of the naive T-cell repertoire.