Cocoa production is highly variable and shows low yields globally, but the drivers of this variation are poorly understood. Climate has been proposed as one of the main drivers, but within-tree competition for resources and disease may also influence the number of cocoa pods produced. In addition, the relative importance of climate and within-tree competition for resources remains unknown. We evaluated the effects of climate, within-tree competition, and disease on cocoa pod dynamics in Ghana and assessed the relative importance of climate and within-tree competition. We monitored cocoa pod dynamics during three years for 1472 trees at 96 farms across Ghana. Counts of pods of different sizes were carried out every six weeks. Climate effects were evaluated based on monthly precipitation and temperature, including lag effects. Effects of within-tree resource competition on pod production were tested by assessing the effect of the number of larger-sized pods on a cocoa tree on the number of pods in smaller size classes using generalised linear mixed-effects models accounting for zero inflation. We consistently found that climate was a stronger driver of pod production than within-tree competition. Across size classes, the climatic conditions experienced at the time of fruit set had the strongest effect on the number of pods. For most pod size classes, both higher temperature and, unexpectedly, higher precipitation negatively influenced pod number. A larger number of large and mature pods negatively affected the number of cherelles (smallest pods), indicating within-tree competition among pods. This suggests that cocoa trees prioritise sustaining pods in larger sizes over producing new ones, for instance, through mechanisms like cherelle wilt. Our results suggest that higher precipitation increased the incidence of fungal diseases and indirectly reduced the number of pods produced. Thus, a combination of lagged climate effects and within-tree competition and disease drives the dynamics and development of pods on cocoa trees. Our results show that lagged climate effects should be considered for adaptation measures to climatic conditions (and climate change) and for determining the best timing for disease management interventions. These results help in understanding cocoa production dynamics and are important for yield and disease modelling.