a–d, Naive P14 T cells were activated with antibodies against CD3 and CD28 for 24 h before transduction with retroviruses encoding TOX (TOXOE) or control GFP. Twenty-four hours after transduction, GFP+ cells were sorted and transferred into day-2 Armstrong-infected recipients. Eight days after transfer, transduced P14 T cells were isolated from spleens and assayed for KLRG1+ T eff cell frequency (a), inhibitory-receptor expression (b), cytokine production after 5 h of restimulation with GP33 peptide (c) and transcription-factor expression (d). e, f, Distribution of memory T cell subsets and PD-1 expression in TOX- versus control-transduced P14 T cells after 30 days of Armstrong infection. g, Genes upregulated (blue) or downregulated (grey) in TOXOE compared with control cells were analysed for enrichment in the transcripts that were differentially expressed in P14 T cells on days 8, 15 and 30 of infection with clone 13 or Armstrong12. Normalized GSEA enrichment scores are plotted against time post-infection. h, The experimental procedure used to generate the datasets analysed in i, j and Fig. 5e, f. NIH3T3 cells were transduced with retroviruses encoding TOX + GFP (TOXOE) or control GFP-only. Cells were cultured for 48 h, then collected and processed for RNA-seq analysis. i, Gene ontology analysis of biological processes differentially regulated in TOXOE versus control fibroblasts. j, As in g, genes upregulated (blue) or downregulated (grey) in fibroblasts were assayed for enrichment in the genes differentially expressed in P14 T cells on days 6, 8, 15 and 30 of infection with clone 13 or Armstrong12. All contour and histogram plots are representative of at least two independent experiments consisting of at least five mice per group. Unless otherwise noted, P14 T cells were analysed from the spleens of infected mice. Statistical significance (*P < 0.01) was determined using the Student’s t-test, error is reported as s.d.