Convert to a peacock mantis tank
But no, seriously, what I usually do is drop all my rock work across the bottom of the tank, making sure to spread it out as much as possible. Once you've done that, it's just a matter of finding the crab at night, grabbing the rock and smashing the crab with a screwdriver or something.
I don't spend a lot of time extracting the crab. If it's stubborn, I just maul it with something sharp. The bristle worms take care of the rest.