High-resolution spatial transcriptomics interrogation of mouse models of viral infection and human samples revealed that the intestinal cellular architecture shapes CD8 T cell diversity in the intestine. This evidence concerns the gene CD8A and viral infectious disease.