Somatic mutations of ERBB2 and ERBB3 (which encode HER2 and HER3, respectively) are found in a wide range of cancers. Preclinical modelling suggests that a subset of these mutations lead to constitutive HER2 activation, but most remain biologically uncharacterized. Here we define the biological and therapeutic importance of known oncogenic HER2 and HER3 mutations and variants of unknown biological importance by conducting a multi-histology, genomically selected, 'basket' trial using the pan-HER kinase inhibitor neratinib (SUMMIT; clinicaltrials.gov identifier NCT01953926). Efficacy in HER2-mutant cancers varied as a function of both tumour type and mutant allele to a degree not predicted by preclinical models, with the greatest activity seen in breast, cervical and biliary cancers and with tumours that contain kinase domain missense mutations. This study demonstrates how a molecularly driven clinical trial can be used to refine our biological understanding of both characterized and new genomic alterations with potential broad applicability for advancing the paradigm of genome-driven oncology.