This study presents a novel five-step ensemble machine learning approach to improve predictive accuracy in assessing climate change impacts on inflow patterns and hydropower generation across seven dam basins in West Africa. The methodology integrates precipitation and temperature using the multi-lag approach. An initial pool of fifteen machine learning models were evaluated, and top-performing models were selected for further refinement through iterative ensemble stacking and weak learner elimination. Historical analysis (1983–2014) utilized CHIRPS and CHIRTS datasets. Future projections employed twelve bias-adjusted CMIP6 models and their ensemble mean (EnsMean) under SSP1-2.6, SSP2-4.5, and SSP5-8.5 for the near (2036–2067) and far (2068–2099) futures. Results showed notable improvements in model accuracy and efficiency across layers, with R² and NSE exceeding 0.6 for all inflow simulations and for selected energy simulations (Bagre, Nangbeto, and Taabo). Projections indicated warming up to 4.5°C and spatially heterogeneous precipitation changes across basins and scenarios, with SSP5-8.5 projecting the most pronounced shifts. Inflow reductions are projected to reach up to 24% at Buyo and 13% at Nangbeto, while hydropower output may decline by up to 19% at Nangbeto and 58% at Taabo in the future. Conversely, Manantali and Taabo are projected to experience inflow increases, and Bagre may see energy gains of up to 42% under SSP5-8.5. These findings highlight heightened vulnerability, as well as contrasting opportunities across the region, underscoring the urgent need for adaptive management strategies, such as enhancing hydropower system resilience, diversifying energy portfolios, and integrating renewable sources to mitigate climate risks. Hydropower managers and policymakers must prioritize proactive measures to ensure energy security and sustainable resource management amid changing climatic conditions.