Advances in sequencing technologies have enabled the identification of mutations acquired by bacterial pathogens during infection. However, it remains unclear whether adaptive mutations fix in the population or lead to pathogen diversification within the patient. Here we study the genotypic diversity of Burkholderia dolosa within individuals with cystic fibrosis by resequencing individual colonies and whole populations from single sputum samples. We find extensive intrasample diversity, suggesting that mutations rarely fix in a patient's pathogen population--instead, diversifying lineages coexist for many years. Under strong selection, multiple adaptive mutations arise, but none of these sweep to fixation, generating lasting allele diversity that provides a recorded signature of past selection. Genes involved in outer-membrane components, iron scavenging and antibiotic resistance all showed this signature of within-patient selection. These results offer a general and rapid approach for identifying the selective pressures acting on a pathogen in individual patients based on single clinical samples.