For protection, it uses its harder- than-diamonds 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.