Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · claude-code

Keep Claude working toward a goal changedgoal

Nearest release: v2.1.233, published 2 hours before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+20added
Lines−15removed
From line 1 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits17to this page, all time

The whole hunk

from line 1, old and new numbered
/
lines
from line 1
11# Keep Claude working toward a goal
22 
3> Set a completion condition with /goal and Claude keeps working across turns until the condition is met.
3> Set a completion condition with /goal and Claude keeps working across turns until the condition is met or judged impossible.
44 
5The `/goal` command sets a completion condition and Claude keeps working toward it without you prompting each step. After each turn, a small fast model checks whether the condition holds. If not, Claude starts another turn instead of returning control to you. The goal clears automatically once the condition is met.
5The `/goal` command sets a completion condition and Claude keeps working toward it without you prompting each step. After each turn, a small fast model checks whether the condition holds. If the model judges it not yet met, Claude starts another turn instead of returning control to you. The goal clears automatically once the condition is met, or if the model judges the condition impossible to satisfy.
66 
77Use a goal for substantial work with a verifiable end state:
88 
from line 15
1515 
1616Three approaches keep the current session running between prompts. Pick based on what should start the next turn:
1717 
18| Approach | Next turn starts when | Stops when |
19| :------------------------------------------------------------------ | :------------------------- | :---------------------------------------------- |
20| `/goal` | The previous turn finishes | A model confirms the condition is met |
21| [`/loop`](/docs/en/scheduled-tasks#run-a-prompt-repeatedly-with-%2Floop) | A time interval elapses | You stop it, or Claude decides the work is done |
22| [Stop hook](/docs/en/hooks-guide#prompt-based-hooks) | The previous turn finishes | Your own script or prompt decides |
18| Approach | Next turn starts when | Stops when |
19| :------------------------------------------------------------------ | :------------------------- | :------------------------------------------------------------ |
20| `/goal` | The previous turn finishes | A model confirms the condition is met or judges it impossible |
21| [`/loop`](/docs/en/scheduled-tasks#run-a-prompt-repeatedly-with-%2Floop) | A time interval elapses | You stop it, or Claude decides the work is done |
22| [Stop hook](/docs/en/hooks-guide#prompt-based-hooks) | The previous turn finishes | Your own script or prompt decides |
2323 
2424`/goal` and a Stop hook both fire after every turn. `/goal` is a session-scoped shortcut: you type a condition and it's active for the current session only. A Stop hook lives in your settings file, applies to every session in its scope, and can run a script for deterministic checks or a prompt for model-evaluated ones.
2525 
from line 45
4545 
4646A goal doesn't change permissions. In the default permission mode, Claude still asks before tool calls that your settings don't already allow, such as the test command above. To let goal turns run unattended, pair `/goal` with [auto mode](/docs/en/auto-mode-config).
4747 
48After each turn, the evaluator returns a short reason explaining why the condition is or isn't met. The most recent reason appears in the status view and in the transcript so you can see what Claude is working toward next.
48While the goal is active, the transcript shows each verdict the evaluator returns, and you can press Ctrl+O to see the reason behind it. The status view also shows the most recent reason, so you can see what Claude is working toward next.
4949 
5050### Write an effective condition
5151 
from line 83
8383 
8484### Clear a goal
8585 
86Run `/goal clear` to remove an active goal before its condition is met.
86Run `/goal clear` to remove an active goal before it resolves.
8787 
8888```text theme={null}
8989/goal clear
from line 105
105105claude -p "/goal CHANGELOG.md has an entry for every PR merged this week"
106106```
107107 
108With the default text output, nothing prints until the condition is met, so a goal that runs many turns can look stuck. Add `--output-format stream-json --verbose` to emit each message as the loop runs.
108With the default text output, nothing prints until the run ends, so a goal that runs many turns can look stuck. Add `--output-format stream-json --verbose` to emit each message as the loop runs.
109109 
110Interrupt the process with Ctrl+C to stop a non-interactive goal before the condition is met.
110Interrupt the process with Ctrl+C to stop a non-interactive goal before it resolves.
111111 
112112## How evaluation works
113113 
114`/goal` is a wrapper around a session-scoped [prompt-based Stop hook](/docs/en/hooks#prompt-based-hooks). Each time Claude finishes a turn, Claude Code sends the condition and the conversation so far to your configured [small fast model](/docs/en/model-config), which defaults to Haiku on the Claude API; on a third-party provider, check your [provider page](/docs/en/third-party-integrations) for the platform's default. The model answers yes or no and gives a short reason.
114`/goal` is a wrapper around a session-scoped [prompt-based Stop hook](/docs/en/hooks#prompt-based-hooks). Each time Claude finishes a turn, Claude Code sends the condition and the conversation so far to your configured [small fast model](/docs/en/model-config), which defaults to Haiku on the Claude API; on a third-party provider, check your [provider page](/docs/en/third-party-integrations) for the platform's default. The model returns one of three verdicts, each with a short reason:
115115 
116* **No**: Claude keeps working and takes the reason as guidance for the next turn.
117* **Yes**: Claude Code clears the goal and records an achieved entry in the transcript.
116* **Not yet met**: Claude keeps working and takes the reason as guidance for the next turn.
117* **Met**: Claude Code clears the goal and records an achieved entry in the transcript.
118* **Impossible**: the evaluator judged that the condition can never be satisfied. Claude Code clears the goal and records a failed entry in the transcript along with the reason. You don't need to clear it yourself.
118119 
120If Claude keeps answering the evaluator without making progress (no tool use for several turns in a row), Claude Code stops the loop, prints a warning, and returns control to you with the goal still set. Evaluation resumes after your next prompt. The [hooks guide](/docs/en/hooks-guide#stop-hook-hits-the-block-cap) explains the underlying mechanism.
121 
122If a subagent or a background shell command is still running when a turn ends, Claude Code skips the evaluation for that turn and evaluates when the next turn ends.
123 
119124To evaluate on a different model, set [`ANTHROPIC_DEFAULT_HAIKU_MODEL`](/docs/en/model-config#environment-variables).
120125 
121126<Warning>
from line 139
134139 
135140## See also
136141 
137* [Run a prompt repeatedly with `/loop`](/docs/en/scheduled-tasks#run-a-prompt-repeatedly-with-%2Floop): re-run on a time interval instead of until a condition holds
142* [Run a prompt repeatedly with `/loop`](/docs/en/scheduled-tasks#run-a-prompt-repeatedly-with-%2Floop): re-run on a time interval instead of toward a condition
138143* [Prompt-based hooks](/docs/en/hooks-guide#prompt-based-hooks): write your own Stop hook when you need custom evaluation logic
139144* [Auto mode](/docs/en/auto-mode-config): approve tool calls automatically so each goal turn runs unattended
140145* [Scheduling comparison](/docs/en/scheduled-tasks#compare-scheduling-options): run work on a schedule independent of any open session
Feedback