Background As we know, immune infiltration play an important role in tumor initiation and progression. Therefore, we devoted to exploring the effect of dynamic evolution of CD8 + T cells on hepatocellular carcinoma (HCC) progression.Methods We comprehensively analyzed gene expression and clinical information in 2,423 HCC cells and 837 HCC samples. Seurat and Monocle algorithms were used to identify CD8 + T cell cluster. Prognostic models were constructed by seven machine learning algorithms, and risk stratification was performed for HCC patients. Immune abundance, enriched function, and mutational profiles of patients in different risk groups were further delineated. Finally, we further validated the results using mIHC in 32 paired HCC and paracancer samples.Results A total of 240 CD8 + T cell trajectory genes were obtained by pseudo-time analysis. Seven machine learning algorithms were used to build optimal prognostic models (ICPM). Patients with high ICPM score had dismal prognosis. Notably, comprehensive analysis revealed that the high-risk group had a higher abundance of immune infiltrates and immunotherapy response rate. The mIHC results further demonstrate the accuracy of our analysis.Conclusion Establishment of ICPM promotes the development of precision therapy for HCC patients and provides new insights for the management and treatment.