  Numerical simulations of active galactic nuclei (AGN) feedback in cool-core
galaxy clusters have successfully avoided classical cooling flows, but often
produce too much cold gas. We perform adaptive mesh simulations that include
momentum-driven AGN feedback, self-gravity, star formation and stellar
feedback, focusing on the interplay between cooling, AGN heating and star
formation in an isolated cool-core cluster. Cold clumps triggered by AGN jets
and turbulence form filamentary structures tens of kpc long. This cold gas
feeds both star formation and the supermassive black hole (SMBH), triggering an
AGN outburst that increases the entropy of the ICM and reduces its cooling
rate. Within 1-2 Gyr, star formation completely consumes the cold gas, leading
to a brief shutoff of the AGN. The ICM quickly cools and redevelops multiphase
gas, followed by another cycle of star formation/AGN outburst. Within 6.5 Gyr,
we observe three such cycles. There is good agreement between our simulated
cluster and the observations of cool-core clusters. ICM cooling is dynamically
balanced by AGN heating, and a cool-core appearance is preserved. The minimum
cooling time to free-fall time ratio typically varies between a few and
$\gtrsim 20$. The star formation rate (SFR) covers a wide range, from 0 to a
few hundred $\rm M_{\odot}\, yr^{-1}$, with an average of $\sim 40 \,\rm
M_{\odot}\, yr^{-1}$. The instantaneous SMBH accretion rate shows large
variations on short timescales, but the average value correlates well with the
SFR. Simulations without stellar feedback or self-gravity produce qualitatively
similar results, but a lower SMBH feedback efficiency (0.1% compared to 1%)
results in too many stars.
