Antibiotic resistant pathogens are an increasing public health threat, as development of novel therapeutics is outpaced by resistance emergence and dissemination. Approaches to slow down or even revert antibiotic resistance are necessary to maintain efficacy of both existing and new antibiotics. Such approaches exploit the fitness cost of resistance elements, but have largely relied on assessing this cost in laboratory conditions that poorly reflect the native context in which pathogens reside. Here we present a method that allows to investigate the influence of personalized human gut microbiota compositions on the competitive fitness of antibiotic resistant pathogens. Using fecal matter-derived microbiomes we identified a specific community that selected for a carbapenem-resistant Klebsiella pneumoniae strain. This selective advantage was due to mutations arising in a LacI-type transcriptional regulator, GlyR, which upregulated expression of the downstream glycoporin GlyP, causing the effect. By deconvoluting the microbiome composition, we identified a focal E. coli strain as a central driver of the selection, which was further modulated by other microbiota members. We further demonstrate that the selective advantage was due to carbohydrate competition, and in particular for glycerol-containing compounds. Importantly, glyR mutations are under strong positive but conditional selection in clinical K. pneumoniae isolates. This implies a reduced competitiveness in other environments, which we experimentally validated in vitro . Overall, this study offers a path to identify microbiome-specific interactions that modulate the competitiveness of antibiotic resistant pathogens.