Tech Update / Adventures with Claude Code #31
/goal – Claude keeps going until it's actually done
"Done!", says Claude. Three tests are still red. I type: "Keep going." Ten minutes later, same again.
Claude stops when the work looks done. With /goal you decide when it is done.
🎯 How it works
/goal all tests in test/auth pass and the lint step is clean
Claude starts right away. After every turn a small, fast model checks whether the condition holds. If not, Claude carries on and gets the reason as a hint. So "done" is no longer decided by the model doing the work.
📏 A good condition
- One measurable end state: a test result, an exit code, an empty list.
- The proof: "
npm testexits with code 0". - What must not happen along the way: "no other test file is modified".
The evaluator doesn't run anything itself. It only judges what is in the conversation. It can't check "the code is clean", but it can check test output.
🔎 Checking and cancelling
/goal on its own shows the condition, runtime, turns, token spend and the latest reason. /goal clear ends the goal. If you resume the session later (part 15), the goal is active again.
🤝 Good combinations
/goal doesn't change permissions. Only together with auto mode (part 30) does it run through without you. And it works without a terminal too (part 13):
claude -p "/goal CHANGELOG.md has an entry for every PR merged this week"
A word of caution:
Every turn costs tokens. Add an upper limit, for example "or stop after 20 turns". If the evaluator considers the condition unreachable, it ends the goal on its own. I wouldn't rely on that.
My rule of thumb:
- A checkable end?
/goal. - Looking in at regular intervals?
/loop(part 23). - Always with a limit: "or stop after 20 turns".
Deutsch
English