‘Metacognition’ refers to thinking about thinking, and its function in collective human behaviour remains largely unknown. Using a multiplayer online game and agent-based modelling, Hawkins et al. found distinctive patterns of collective intelligence that only emerge when using metacognitive social inference skills.