Ergot alkaloids are highly diverse in structure, exhibit diverse effects on animals, and are produced by diverse fungi in the phylum Ascomycota, including pathogens and mutualistic symbionts of plants. These mycotoxins are best known from the fungal family Clavicipitaceae and are named for the ergot fungi that, through millennia, have contaminated grains and caused mass poisonings, with effects ranging from dry gangrene to convulsions and death. However, they are also useful sources of pharmaceuticals for a variety of medical purposes. More than a half-century of research has brought us extensive knowledge of ergot-alkaloid biosynthetic pathways from common early steps to several taxon-specific branches. Furthermore, a recent flurry of genome sequencing has revealed the genomic processes underlying ergot-alkaloid diversification. In this review, we discuss the evolution of ergot-alkaloid biosynthesis genes and gene clusters, including roles of gene recruitment, duplication and neofunctionalization, as well as gene loss, in diversifying structures of clavines, lysergic acid amides, and complex ergopeptines. Also reviewed are prospects for manipulating ergot-alkaloid profiles to enhance suitability of endophytes for forage grasses.