Cyclodipeptide synthases (CDPSs) can catalyze the formation of two successive peptide bonds by hijacking aminoacyl-tRNAs from the ribosomal machinery resulting in diketopiperazines (DKPs). Here, three CDPS-containing loci (dmt1-3) are discovered by genome mining and comparative genome analysis of Streptomyces strains. Among them, CDPS DmtB1, encoded by the gene of dmt1 locus, can synthesize cyclo(L-Trp-L-Xaa) (with Xaa being Val, Pro, Leu, Ile, or Ala). Systematic mutagenesis experiments demonstrate the importance of the residues constituting substrate-binding pocket P1 for the incorporation of the second aa-tRNA in DmtB1. Characterization of dmt1-3 unravels that CDPS-dependent machinery is involved in CDPS-synthesized DKP formation followed by tailoring steps of prenylation and cyclization to afford terpenylated DKP compounds drimentines. A phytoene-synthase-like family prenyltransferase (DmtC1) and a membrane terpene cyclase (DmtA1) are required for drimentines biosynthesis. These results set the foundation for further increasing the natural diversity of complex DKP derivatives.