Infants experience a dramatic change in their food in the first year after birth when they shift from breast milk to solid food. This results in a large change in presence of indigestible polysaccharides, a primary energy resource of gut microbes. How the gut microbiota adapts to this dietary shift has not been well examined. Here, by using metagenomics data, we studied carbohydrate-active enzymes (CAZymes) of gut microbiota, which are essential enzymes catalyzing the breakdown of polysaccharides, during this dietary shift. We developed a new approach to categorize CAZyme families by food intake and found CAZyme families associated with milk or solid food. We also found CAZymes with most abundance in 12 months infants that are not associated with solid food or milk but may be related to modulating carbohydrates in the mucus. Additionally, the abundance of gut CAZymes were found to be affected by many other factors, including delivery modes and life style in adults. Taken together, our findings provide novel insights into the dynamic change of gut CAZymes in early human life and provide potential markers for food interference or gut microbiota restoration.