The goby is completely inside the clam? How long has he been in there? And how do you know (did you see it swim in)?
First I would wait maybe 30 minutes or so. If you saw it swim in... what are the chances you would be there to see it? I'm thinking if you saw it, it has probably happened before. So I would wait to see if they can sort it out.
If not... the clam is probably good as dead anyway, with the goby freaking out stirring up it's insides. In which case I would pry the clam open so you can at least save the goby.