The fate of developing T cells is specified by the interaction of their antigen receptors with self-peptide-MHC complexes that are displayed by thymic antigen-presenting cells (APCs). Various subsets of thymic APCs are strategically positioned in particular thymic microenvironments and they coordinate the selection of a functional and self-tolerant T cell repertoire. In this Review, we discuss the different strategies that these APCs use to sample and process self antigens and to thereby generate partly unique, 'idiosyncratic' peptide-MHC ligandomes. We discuss how the particular composition of the peptide-MHC ligandomes that are presented by specific APC subsets not only shapes the T cell repertoire in the thymus but may also indelibly imprint the behaviour of mature T cells in the periphery.