CuspCore describes the formation of flat cores in dark matter haloes and ultra-diffuse galaxies from feedback-driven outflow episodes. The halo response is divided into an instantaneous change of potential at constant velocities followed by an energy-conserving relaxation. The core assumption of the model is that the total energy E=U+K is conserved for each shell enclosing a given dark matter mass, which is treated in the code as a least-square minimization of the difference between the final and the initial energy of each shell.