Purpose This study aims to investigate the relationship between climate policy uncertainty (CPU) and corporate environmental, social and governance (ESG) performance. We attempt to uncover the underlying rationale of how CPU influences corporate ESG performance and provides empirical evidence for companies’ strategic enhancement of ESG performance with risk reduction objectives. Design/methodology/approach We conduct a regression analysis using panel data from 4,490 Chinese listed companies spanning the period from 2011 to 2022. In addition, we use propensity score matching analysis (PSM), two-stage least squares (2SLS), system generalized method of moments (sys-GMM) and difference-in-differences (DID) methods to analyze the enterprise systematic risk. Findings The empirical findings reveal a positive correlation between CPU and corporate ESG performance, with a stronger effect observed in non-state-owned enterprises, heavy-polluting industries and those facing fierce market competition and strict environmental regulation. Mechanism analysis suggests that as CPU increases, companies with higher systemic risk tend to improve ESG performance more significantly, highlighting risk mitigation as a primary motive. Robustness tests further validate the consistency of our conclusions. Additionally, we find that enhancing ESG performance helps mitigate the risks and improve total factor productivity arising from the increased CPU. Originality/value This study examines the impact of CPU on the ESG performance of Chinese listed companies and its underlying logic. The conclusions of this paper provide important policy references for coordinated development and security, as well as for effectively mitigating the adverse impact of CPU. We hope to offer insights for companies to identify potential risk factors, thereby enhancing their level of sustainable development and sense of environmental responsibility.