The human gut microbiome, of which the genus Bifidobacterium is a prevalent and abundant member, is thought to sustain and enhance human health. Several surface-exposed structures, including so-called sortase-dependent pili, represent important bifidobacterial gut colonization factors. Here we show that expression of two sortase-dependent pilus clusters of the prototype Bifidobacterium breve UCC2003 depends on replication slippage at an intragenic G-tract, equivalents of which are present in various members of the Bifidobacterium genus. The nature and extent of this slippage is modulated by the host environment. Involvement of such sortase-dependent pilus clusters in microbe-host interactions, including bacterial attachment to the gut epithelial cells, has been shown previously and is corroborated here for one case. Using a Maximum Depth Sequencing strategy aimed at excluding PCR and sequencing errors introduced by DNA polymerase reagents, specific G-tract sequences in B. breve UCC2003 reveal a range of G-tract lengths whose plasticity within the population is functionally utilized. Interestingly, replication slippage is shown to be modulated under in vivo conditions in a murine model. This in vivo modulation causes an enrichment of a G-tract length which appears to allow biosynthesis of these sortase-dependent pili. This work provides the first example of productive replication slippage influenced by in vivo conditions. It highlights the potential for microdiversity generation in "beneficial" gut commensals.