brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: /goal keeps Claude working until a condition you wrote is true

Claude
~/tips/tip-claude-goal-condition

/goal all tests in test/auth pass and the lint step is clean

Keeps Claude Code working turn after turn until a condition you describe is met.

"Keep going until the tests pass" is something I type a lot in my head. There is a command for it.

Set a completion condition and Claude keeps taking turns without you prompting each one.

/goal all tests in test/auth pass and the lint step is clean

After every turn a small fast model checks the condition against the conversation. Not met, and Claude starts another turn. Met, and the goal clears. If the evaluator judges it impossible, it clears too. Plain /goal shows status, and /goal clear removes it.

The evaluator does not run commands or read files. It only judges what Claude has shown in the conversation. So write a condition Claude's own output can prove, such as "npm test exits 0", and add a bound like "or stop after 20 turns".

The difference with an ordinary prompt is who decides that the work is done. Normally Claude decides, and it stops when it thinks it has finished. With a goal, a separate model checks your wording after every turn, so the work does not end just because the first model sounds confident.

It also works headless: claude -p "/goal ..." runs the loop to the end in one go. In Manual mode Claude still asks before tool calls, so use auto mode if you want it unattended.

Further reading: Keep Claude working toward a goal – Claude Code docs, Commands – Claude Code docs, On this site: /copy 2 copies Claude's second-to-last answer, not just the last, On this site: /context shows what is eating your Claude Code context window

More Claude tips /recap /focus /skill-doctor /autocompact 500k claude purge ~/work/my-repo --dry-run All Claude tips (83) All topics

Link