Mesenteric lymph node (mLN) T cells undergo tissue adaptation upon migrating to intestinal lamina propria and epithelium, ensuring appropriate balance between tolerance and resistance. By combining mouse genetics with single-cell and chromatin analyses, we uncovered the molecular imprinting of gut epithelium on T cells. Transcriptionally, conventional and regulatory (Treg) CD4+ T cells from mLN, lamina propria and intestinal epithelium segregate based on the gut layer they occupy; trajectory analysis suggests a stepwise loss of CD4 programming and acquisition of an intraepithelial profile. Treg cell fate mapping coupled with RNA sequencing and assay for transposase-accessible chromatin followed by sequencing revealed that the Treg cell program shuts down before an intraepithelial program becomes fully accessible at the epithelium. Ablation of CD4-lineage-defining transcription factor ThPOK results in premature acquisition of an intraepithelial lymphocyte profile by mLN Treg cells, partially recapitulating epithelium imprinting. Thus, coordinated replacement of the circulating lymphocyte program with site-specific transcriptional and chromatin changes is necessary for tissue imprinting.