Background Clostridium difficile infection (CDI) is now the most common cause of healthcare-associated infections, with increasing prevalence, severity, and mortality of nosocomial and community-acquired CDI which makes up approximately one third of all CDI. There are also increased rates of asymptomatic colonization particularly in high-risk patients. C difficile is a known collagenase-producing bacteria which may contribute to anastomotic leak (AL). Methods Machine learning-augmented multivariable regression and propensity score (PS)-modified analysis was performed in this nationally representative case-control study of CDI and anastomotic leak, mortality, and length of stay for colectomy patients using the ACS-NSQIP database. Results Among 46 735 colectomy patients meeting study criteria, mean age was 61.7 years (SD 14.38), 52.2% were woman, 72.5% were Caucasian, 1.5% developed CDI, 3.1% developed anastomotic leak, and 1.6% died. In machine learning (backward propagation neural network)-augmented multivariable regression, CDI significantly increases anastomotic leak (OR 2.39, 95% CI 1.70-3.36; P < .001), which is similar to the neural network results. Having CDI increased the independent likelihood of anastomotic leak by 3.8% to 6.8% overall, and in dose-dependent fashion with increasing ASA class to 4.3%, 5.7%, 7.6%, and 10.0%, respectively, for ASA class I to IV. In doubly robust augmented inverse probability weighted PS analysis, CDI significantly increases the likelihood of AL by 4.58% (95% CI 2.10-7.06; P < .001). Conclusions This is the first known nationally representative study on CDI and AL, mortality, and length of stay among colectomy patients. Using advanced machine learning and PS analysis, we provide evidence that suggests CDI increases AL in a dose-dependent manner with increasing ASA Class.