A search is reported for charge-parity CP violation in D0 → K0 SK0 S decays, using data collected in proton– proton collisions at √s = 13 TeV recorded by the CMS experiment in 2018. The analysis uses a dedicated data set that corresponds to an integrated luminosity of 41.6 fb−1 , which consists of about 10 billion events containing a pair of b hadrons, nearly all of which decay to charm hadrons. The flavor of the neutral D meson is determined by the pion charge in the reconstructed decays D∗+ → D0 π+ and D∗− → D0 π−. The CP asymmetry in D0 → K0 SK0 S is measured to be ACP(K0 SK0 S) = (6.2 ± 3.0 ± 0.2 ± 0.8)%, where the three uncertainties represent the statistical uncertainty, the systematic uncertainty, and the uncertainty in the measurement of theCP asymmetry in the D0 → K0 Sπ+π− decay. This is the first CP asymmetry measurement by CMS in the charm sector as well as the first to utilize a fully hadronic final state.