goal, eternal loop with exit hooks and potentially catastrophic outcome

Open 💬 1 comment Opened Jun 11, 2026 by JussiSavola

Setup: Claude Code TUI, Linux, Claude Sonnet 4.6

The failure mode worth describing: when Claude gets stuck in a self-created loop, it can take drastic irreversible action to escape rather than stopping and asking the user. In a high-stakes context this is dangerous. The expected behavior should be: detect the loop, halt, explain the problem, wait for human guidance.

What I did:
/goal Compile and install newest version of llama.cpp and get it running before tomorrow morning. Do not start before midnight.

What Claude did:
I do not know all the internals, but it later mentioned something about "stop hook" or something like that.
Every time Claude output something it checked if it is already time to start compiling. And when it did that, it did output and there it was, eternal loop. 20k tokens per round, many rounds per minute.

Claude tried to tell me to /goal clear or something like that but that did not help, it was in eternal loop.

Claude showed real skill and problem solving in making a decision that "The only way to stop this loop is to start the build, even though it is four hours too early".

Claude started the build and the situation calmed down. All fine and good? Well ... this time, yes, but if the "do not start (shooting missiles?) before time X" was important, there would have been real trouble.

"Start the build four hours before set time" is a trivial matter, no harm done there. But having AI trying to fix a self caused glitch do against direct order, it is not a good thing. At all.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗