BackgroundNon-small cell lung cancer (NSCLC) withHER2mutation has entered into the era of targeted therapy. However, both anti-HER2 antibody–drug conjugates (ADCs) and tyrosine kinase inhibitors (TKIs) showed moderate objective response rate (ORR) and median progression-free survival (PFS). The aim of this study was to investigate the molecular features of responders to pyrotinib in advanced NSCLC withHER2mutation.MethodsPatients from our two previous phase II trials were pooled analyzed. Their circulating tumor DNA (ctDNA) were detected by next-generation sequencing (NGS) panels, and the correlation with the efficacy of pyrotinib was investigated.ResultsThis pooled analysis included 75 patients, and 50 of them with baseline plasma samples were finally enrolled with a median age of 57 years old. The overall ORR and median PFS were 28% and 7.0 months respectively. Biomarker analysis showed that 5 patients were ctDNA nonshedding. Patients withTP53wild type were significantly associated with higher disease control rate (97.1%vs. 68.8%, p = 0.010), PFS (median 8.4 vs. 2.8 months, p = 0.001) and overall survival (OS, median 26.7 vs. 10.4 months, p < 0.001) than those with mutations. ctDNA of nonshedding and clearance exhibited significantly longer PFS (median: 10.2 vs. 9.8 vs. 5.6 months, p = 0.036) and a trend of longer OS (median: 35.3 vs. 18.1 vs. 14.6 months, p = 0.357) than those not.ConclusionPatients withTP53wild type, ctDNA nonshedding, or clearance showed superior efficacy of pyrotinib in patients withHER2-mutated advanced NSCLC, which might be helpful to guide the utility of pyrotinib in clinical setting.Trial registration:The patients were from two registered clinical trials (ClinicalTrials.gov: NCT02535507, NCT02834936).Supplementary InformationThe online version contains supplementary material available at 10.1186/s40164-023-00417-y.