Command reference ยท Claude Code
/goal
Sets a goal: Claude keeps working across multiple turns until the condition is met.
/goal [condition|clear] sets a completion condition that Claude pursues across multiple turns without each step needing to be triggered again. After each turn, a small, fast model (Haiku by default) checks against the conversation whether the condition is met; if not, another turn begins automatically. Once the condition is met, the goal is automatically cleared. Without an argument, the command shows the current or most recently reached goal along with turn count and token consumption. clear, stop, off, reset, none, and cancel remove an active goal early.
A goal doesn't change permissions - in default mode, Claude still asks before tool calls that aren't already allowed; for unattended turns, /goal can be combined with auto mode. Only one goal is active per session at a time; a newly set one replaces an existing one. The check is based purely on what Claude has made visible in the conversation so far - the evaluator doesn't call any tools itself and doesn't re-read files.
๐ฌ AS A SHORT VIDEO
Sets a goal: Claude keeps working across multiple turns until the condition is met.
โ WHEN TO USE IT?
Multi-step task with a clearly checkable end state
/goal all tests in test/auth pass and the lint step is clean
Limit a goal with a turn or time cap
/goal migrate all call sites to the new API, or stop after 20 turns
Stop a running goal early
/goal stop
โ WHEN NOT TO?
Recurring ongoing task across sessions
/goal is tied to a one-time completion condition within the current session, not meant for permanently recurring checks.
Better: Use /loop, e.g. /loop 30m check for new support tickets.
Fundamentally trying a different approach
A new goal only changes the completion condition for the next turns, not the approach taken so far or the conversation history.
Better: Use /branch to branch off in a different direction from this point.
SOURCES
- Claude Code docs (official) โ code.claude.com
MORE COMMANDS ยท Claude Code