Maybe this:
Soon after the live crab has exited (the larger, green crab in adjacent photo) they bury themselves in sand to allow their new shell to harden. Adult crab populations tend to molt simultaneously, Females in the spring, Males in the late summer. It often produces a scene like this one