Your clam is in real trouble. There could be more than one problem.
You need to get rid of all those pyramid snails. After your lights have been off for an hour or 2 take the clam out and put him in a bowl of tank water. Check every inch of the clam for even the smallest snails and get rid of them! This has to be done again and again over days/weeks. There are probably hundreds of those snails in your tank if you aqre finding multiple ones on your clam.
Are you feeding live phyto? Clams need to be fed appropriate food, especially if they are under 3 inches.
Last, what type of clam is it, and what kind of lights do you have?