For protection, it uses its harder-than-diamond shell. It also shoots spikes from the shell.
If areas of Cloyster’s very hard shell get damaged, those areas swell, gradually growing into large sharp spikes.