Genomics has greatly improved how patients with cancer are being treated; however, clinical-grade genomic biomarkers for chemotherapies are currently lacking. Using whole-genome analysis of 37 patients with metastatic colorectal cancer (mCRC) treated with the chemotherapy trifluridine/tipiracil (FTD/TPI), we identified KRAS codon G12 (KRASG12) mutations as a potential biomarker of resistance. Next, we collected real-world data of 960 patients with mCRC receiving FTD/TPI and validated that KRASG12 mutations were significantly associated with poor survival, also in analyses restricted to the RAS/RAF mutant subgroup. We next analyzed the data of the global, double-blind, placebo-controlled, phase 3 RECOURSE trial (n = 800 patients) and found that KRASG12 mutations (n = 279) were predictive biomarkers for reduced overall survival (OS) benefit of FTD/TPI versus placebo (unadjusted interaction P = 0.0031, adjusted interaction P = 0.015). For patients with KRASG12 mutations in the RECOURSE trial, OS was not prolonged with FTD/TPI versus placebo (n = 279; hazard ratio (HR) = 0.97; 95% confidence interval (CI) = 0.73-1.20; P = 0.85). In contrast, patients with KRASG13 mutant tumors showed significantly improved OS with FTD/TPI versus placebo (n = 60; HR = 0.29; 95% CI = 0.15-0.55; P < 0.001). In isogenic cell lines and patient-derived organoids, KRASG12 mutations were associated with increased resistance to FTD-based genotoxicity. In conclusion, these data show that KRASG12 mutations are biomarkers for reduced OS benefit of FTD/TPI treatment, with potential implications for approximately 28% of patients with mCRC under consideration for treatment with FTD/TPI. Furthermore, our data suggest that genomics-based precision medicine may be possible for a subset of chemotherapies.