To antagonize the inhabitants of the Orphan Shack
The crabs (usually referred to as the "tiny, territorial crabs") are land crabs which infest the Orphans Shack of Prufrock Preparatory School, where the Baudelaire orphans are forced to live in The Austere Academy.
The crabs are described as the size of small matchboxes and display aggressive behavior toward intruders on the Shack. They are afraid of loud noises, prompting Violet to design "noisy shoes" for her siblings and Duncan and Isadora Quagmire. When Vice Principal Nero forces Sunny to make her own staples, Violet provokes one of the crabs into clipping the metal rods with its claws.