Glacier retreat is a visible consequence of climate change worldwide. Although taxonomic change of the soil microbiomes in glacier forefields have been widely documented, how microbial genetic potential changes along succession is little known. Here, we used shotgun metagenomics to analyse whether the soil microbial genetic potential differed between four stages of soil development (SSD) sampled along three transects in the Damma glacier forefield (Switzerland). The SSDs were characterized by an increasing vegetation cover, from barren soil, to biological soil crust, to sparsely vegetated soil and finally to vegetated soil. Results suggested that SSD significantly influenced microbial genetic potential, with the lowest functional diversity surprisingly occurring in the vegetated soils. Overall, carbohydrate metabolism and secondary metabolite biosynthesis genes overrepresented in vegetated soils, which could be partly attributed to plant–soil feedbacks. For C degradation, glycoside hydrolase genes enriched in vegetated soils, while auxiliary activity and carbohydrate esterases genes overrepresented in barren soils, suggested high labile C degradation potential in vegetated, and high recalcitrant C degradation potential in barren soils. For N-cycling, organic N degradation and synthesis genes dominated along succession, and gene families involved in nitrification were overrepresented in barren soils. Our study provides new insights into how the microbial genetic potential changes during soil formation along the Damma glacier forefield.