A large family of cytotoxic cyclic peptides exemplified by the patellamides has been isolated from ascidians harboring the obligate cyanobacterial symbionts Prochloron spp.(1-5). Genome sequence analysis of these symbionts has revealed that Prochloron spp. synthesize patellamides by a ribosomal pathway(6). To understand how this pathway evolved to produce a suite of related metabolites, we analyzed 46 prochloron-containing ascidians from the tropical Pacific Ocean for the presence of patellamide biosynthetic genes and taxonomic markers. Here, we show that Prochloron spp. generate a diverse library of patellamides using small, hypervariable cassettes within a conserved genetic background. Each symbiont strain contains a single pathway, and mixtures of symbionts within ascidians lead to the accumulation of chemical libraries. We used this information to engineer the production of a new cyclic peptide in Escherichia coli, thereby demonstrating the power of comparative analysis of closely related symbiotic pathways to direct the genetic synthesis of new molecules.