The pistol shrimp used to astound scientists: It did...something..., and then fish in front of it abruptly dropped dead. The fishy victim is then pulled inside the pistol shrimp's burrow and devoured. Clearly, this had to be studied.
It was discovered how this works by filming the shrimp firing in slow motion. All the shrimp does is close its claw really really fast. The rapidly increasing pressure causes a cavitation bubble with temperatures rivaling the surface of the sun. This then, surrounded by seawater, explodes slightly as everything condenses back to normal. The heat, pressure, and shock wave all injure the shrimp's prey, usually adding up to a fatality. And knowing all this gave me the idea to weaponize it.
The weaponized pistol shrimp robot would swim up to things we don't like underwater, such as the propellers of an enemy submarine. It would then bring a massive claw as close as possible as close to the propellers as possible, and then very abruptly close it. With a loud banging sound, the propellers are promptly damaged by the ensuing cavitation bubble, as cavitation is the bane of naval propellers everywhere. The submarine is now mobility-killed, and can be finished off with a cleverly placed depth charge if it continues to cause problems. Or if this is done to a surface ship, that ship isn't sailing anywhere anytime soon. If it causes more problems, it'll wind up torpedoed, or we could cavitation attack the hull to sink it.
The robot can then swim to the next target, as an enemy that has one boat probably has a lot more.
Unfortunately, this won't be too useful in modern warfare, as all our battles are mostly against asymmetric enemies who don't have navies, because they aren't nations. Most of our enemies now are insurgents, and stopping them requires a whole different type of fighting than the kind that stops nations.