AIDS is caused by CD4 T-cell depletion. Although combination antiretroviral therapy can restore blood T-cell numbers, the clonal diversity of the reconstituting cells, critical for immunocompetence, is not well defined.We performed an extensive analysis of parameters of thymic function in perinatally HIV-1-infected (n = 39) and control (n = 28) participants ranging from 13 to 23 years of age. CD4 T cells including naive (CD27 CD45RA) and recent thymic emigrant (RTE) (CD31/CD45RA) cells, were quantified by flow cytometry. Deep sequencing was used to examine T-cell receptor (TCR) sequence diversity in sorted RTE CD4 T cells.Infected participants had reduced CD4 T-cell levels with predominant depletion of the memory subset and preservation of naive cells. RTE CD4 T-cell levels were normal in most infected individuals, and enhanced thymopoiesis was indicated by higher proportions of CD4 T cells containing TCR recombination excision circles. Memory CD4 T-cell depletion was highly associated with CD8 T-cell activation in HIV-1-infected persons and plasma interlekin-7 levels were correlated with naive CD4 T cells, suggesting activation-driven loss and compensatory enhancement of thymopoiesis. Deep sequencing of CD4 T-cell receptor sequences in well compensated infected persons demonstrated supranormal diversity, providing additional evidence of enhanced thymic output.Despite up to two decades of infection, many individuals have remarkable thymic reserve to compensate for ongoing CD4 T-cell loss, although there is ongoing viral replication and immune activation despite combination antiretroviral therapy. The longer term sustainability of this physiology remains to be determined.