T cells play an important role in combatting pathogens. T cells recognize virus-infected cells via their T-cell receptors and are able to clear virus-infected cells from the body. Every T cell has a unique T-cell receptor, which can recognize a different part of the virus. The repertoire of all these different T cells differs between individuals and plays a role in the quality of the immune response against virus infections. In this thesis, changes in the T-cell repertoire over time and after infection and vaccination were studied. In the first part, it is shown that the diversity of the virus-specific T-cell repertoire decreases with age. This effect is most pronounced in individuals who are infected with cytomegalovirus (CMV). Nevertheless, we found that co-infection with CMV does not lead to a diminished immune response to an acute infection. The second part of this thesis focuses on how the T-cell repertoire can be shaped, with the aim to maintain a diverse T-cell repertoire at older age. Therefore, we investigated the effect of boosting the T-cell response at different time intervals, and by inducing T-cell responses via peptide vaccination. Together, this information is of importance to identify individuals at risk for infections, and to allow for a more personalized vaccination strategy based on the T-cell response.