E. Cobham Brewer 18101897. Dictionary of Phrase and Fable. 1898.
Close as a Clam.
A clam is a bivalve mollusca, which burrows in sand or mud. It is about the size of a florin, and may be eaten raw or fried like an oyster. Clams are gathered only when the tide is out. When the tide is in they are safe from molestation, hence the saying Happy as a clam at high tide (Anglo-Saxon clam, mud verb clm-ian, to glue German, klamm, close.)