Gene transfer agents (GTAs) are virus-like elements that are encoded by some bacterial and archaeal genomes. The production of GTAs can be induced by the carbon depletion and results in host lysis and release of virus-like particles that contain mostly random fragments of the host DNA. The remaining members of a GTA-producing population act as GTA recipients by producing proteins needed for the GTA-mediated DNA acquisition. Here, we detect a strong codon usage bias in alphaproteobacterial RcGTA-like GTA genes, which likely improves the translational efficacy during their expression. While the strength of selection for translational efficiency fluctuates substantially among individual GTA genes and various taxonomic groups, it is especially pronounced in Sphingomonadales, whose members are known to inhabit nutrient-depleted environments. Additionally, the intensity of the selection acting on GTA genes negatively correlates with the carbon content of the encoded proteins, indicating the importance of controlling energetic cost of potentially frequent GTA production. By screening genomes for gene families with similar trends in codon usage biases to those in GTA genes, we found a gene that likely encodes head completion protein in some GTAs were it appeared missing, and 13 genes previously not implicated in GTA lifecycle. The latter genes are involved in a range of molecular processes, including the homologous recombination and response to the carbon starvation. Our findings highlight host-driven evolution of GTA genes expressed under nutrient-depleted conditions, and outline genes that are potentially involved in the previously hypothesized integration of GTA-delivered DNA into the host genome.