Reversal of CD8 T-cell exhaustion was considered a major antitumor mechanism of anti-programmed cell death-1 (PD-1)/ anti-programmed death ligand-1 (PD-L1)-based immune checkpoint inhibitor (ICI) therapy. The aim of this study was to identify markers of T-cell exhaustion that is best associated with ICI treatment efficacy for advanced hepatocellular carcinoma (HCC). Here, we identified a 9-gene signature (LAG3, CD244, CCL5, CXCL9, CXCL13, MSR1, CSF3R, CYBB, and KLRK1) which was functionally associated with CD8 T cell exhaustion. This 9-gene signature had similar predictive values for patients who received single-agent or combination ICI therapy and was not associated with prognosis in HCC patients who received surgery, suggesting that it may outperform other T-cell signatures for predicting efficacy of ICI therapy for HCC. For HCC patients who underwent surgery for both the primary liver and metastatic lung tumors (n = 31), lung metastatic HCC was associated with a higher exhausted CD8 T-cell signature, consistent with prior observation that patients with lung metastatic HCC may have higher probability of response to ICI therapy. CD8 T-cell exhaustion in tumor microenvironment may predict better efficacy of ICI therapy for HCC.