Here we reveal that epigenetic characteristics of baseline CD8+ T cells can be used to identify metastatic GC patients who may benefit from anti-PD-1 therapy. This evidence concerns the gene CD8A and gastric cancer.