CRISPR–Cas systems confer adaptive immunity against exogenic elements in bacteria and archaea, and provide unprecedented potential for genome editing that is revolutionizing biological and clinical research. Current CRISPR–Cas systems are based on enzymes that were identified in isolated bacteria, thus excluding the majority of enzymes from organisms that have not been cultured in the laboratory. Using metagenomics, Burstein et al. uncovered novel CRISPR–Cas systems in uncultured microbial communities, including samples from the infant gut, soil and groundwater. Their analysis focused on identifying uncharacterized genes that were proximal to CRISPR arrays and CRISPR-associated protein 1 (cas1), which is the conserved CRISPR integrase. They analysed 155 million proteins and identified the first Cas9 (type II) system in archaea. Previously, archaea were known to use class I systems, and class II systems had only been found in bacteria. In addition, the authors identified two new compact CRISPR–Cas systems in uncultured bacteria that they named CRISPR–CasX and CRISPR–CasY. All of the functional components of these two systems were identified using metagenomics, which enabled the expression of these systems in Escherichia coli, leading to robust RNA-guided DNA interference of a plasmid that contained target sequences. As the newly identified DNA-interference systems contain a small number of proteins, they are particularly valuable for the development of new gene-editing tools for biological and clinical research.