Clams have the ability to repair and regenerate their shells, which are composed primarily of calcium carbonate .