Notices when Claude runs the same test command and it fails twice in a row, and tells Claude to stop and ask for a second opinion.
After every Bash command, it checks whether the command ran a test suite: pytest, npm, pnpm, yarn or bun test, vitest, jest, go test, cargo test, rspec, phpunit, dotnet test, make test and a few more. It finds the test command anywhere in a chain, so cd app && npm test counts and grep pytest notes.txt doesn't.
On the second failure in a row of the same command, it does two things:
- Shows a toast naming the command.
- Adds a note to the command's result telling Claude to stop fixing and ask for a second opinion.
A pass resets the count. The main session and each subagent keep separate counts.
The note is the note option in .claude-plugin/plugin.json. The default asks Claude to brief the second-opinion, second-opinion-sonnet and second-opinion-haiku agents side by side, which are custom agent types running Fable 5.1, Sonnet 5.5 and Haiku 5.5 at high effort, the same as the pre-PR reviewers. If you don't have agents with those names, change the default to whatever you want Claude to do.
It isn't on a marketplace. Clone the repo and load the folder:
git clone https://github.com/cprentice9/ccmods.gitclaude --plugin-dir ccmods/stuck-detectorThe ccmods README explains how to load it in every session, including desktop app sessions.
From the ccmods folder:
claude plugin validate stuck-detectorclaude plugin test stuck-detector