Anthropic launched the /goal slash command for its Claude Code terminal app, fundamentally altering how developers interact with the AI assistant. Users initially mistook the feature as just another way to write a standard prompt to generate code. It actually functions exactly like a “while” loop in programming.
Instead of executing a single-pass function call and returning control to the user to manually verify test cases or fix errors, the /goal command forces Claude to work autonomously. The AI iterates on a problem continuously without stopping until the user’s explicitly set condition is fully met.
This shift to a “depth-first” iterative loop execution means developers must establish clearly defined, testable success criteria before walking away from the keyboard. The feature represents a macro-industry shift from simple conversational prompting to autonomous, multi-step agent workflows natively operating inside the terminal.
How the Dual-Model Stop Hook Prevents Endless Loops
Handing over complete autonomous control to an AI agent introduces immediate financial risks. Because the command loops sequentially on a single complex task, compute costs scale directly with the number of iterations required to reach a verified end state. A poorly defined goal could theoretically cause the AI to loop and spend tokens forever.
Anthropic engineered a specific “Stop hook” evaluation system to solve this hardware runaway problem. At the end of every turn, a secondary, smaller model—such as Claude 3 Haiku—is triggered. Users running the required v2.1.139 update rely on this small-model Stop hook evaluator to independently check if the exact conditions of the contract are finally satisfied.
The main model executes the complex code changes, while the separate Haiku model acts purely as a referee. Once the smaller model confirms the specific condition is met, it signals the system to terminate the loop and hand control back to the human developer.

