New lineages of SARS-CoV-2 are constantly emerging. They contain mutations in the spike glycoprotein that can affect virus infectivity, transmissibility, or sensitivity to vaccine-elicited antibodies. Here we show that the emergence of new spike variants is accurately predicted by patterns of amino acid variability (volatility) in small virus clusters that phylogenetically-precede or chronologically-predate such events. For each spike position, volatility within the virus clusters, volatility at adjacent positions on the three-dimensional structure of the protein, and volatility across the network of co-volatile sites describe its likelihood for mutations. By combining these variables, early-pandemic sequences accurately forecasted mutations in lineages that appeared 6-13 months later. The patterns of mutations in variants Alpha and Delta, as well as the recently-appearing variant Omicron were also predicted remarkably well. Importantly, probabilities assigned to spike positions for within-lineage mutations were lineage-specific, and accurately forecasted the observed changes. Sufficient antecedent warning of the imminent changes in SARS-CoV-2 lineages will allow design of immunogens that address their specific antigenic properties.