In short.
This guide explains Claude Code’s /goal command for developers automating substantial coding tasks, but its evaluator cannot independently inspect files or run checks. It documents continued work across turns, completion conditions, permission requirements and recovery behavior. Its main practical value is explaining how to make progress visible to the evaluator and how goals stop, pause or resume. Runtime reliability, completion accuracy and actual costs have not been assessed.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage is the complete selected documentation page at [https://code.claude.com/docs/en/goal.md], including its permission and trust requirements, model-configuration warning, billing note, error handling and version-specific behavior. Linked documentation, the documentation index and external pricing or licensing terms are excluded. No commands were executed. Completion accuracy, platform behavior, retry and resume behavior, runtime reliability and actual charges remain unverified.
The overview
Identity
Keep Claude working toward a goal is a Claude Code documentation guide at [https://code.claude.com/docs/en/goal.md]. It teaches the /goal feature, which continues a session across multiple turns while a separate model evaluates a completion condition.
The resource is an instructional page. It supplies usage examples and operational details, but no downloadable implementation, model weights or dataset.
Assessment
The guide is useful for developers whose tasks have an observable finish: passing tests, compiling migrated call sites, satisfying acceptance criteria or emptying an issue queue. It explains both the command and the conditions that can interrupt continued work.
Its central limitation is the evidence available to the evaluator. A completion verdict reflects what the conversation shows. The page supplies no measurements of incorrect verdicts, successful task completion or time saved.
Users
Developers already using Claude Code can apply this guide to API migrations, implementation from a design document, module refactoring and labeled issue backlogs. Beginners receive basic commands for setting, inspecting and clearing a goal; experienced developers receive details about hooks, environment variables and non-interactive execution.
The feature is most suitable when the developer can define a measurable result and identify commands or outputs that demonstrate it. Unattended operation also depends on the session’s tool permissions.
Capabilities
One goal can be active per session. Setting another replaces it and immediately starts a turn. The condition can contain up to 4,000 characters. Status displays the condition, elapsed time, evaluated turns, token spend and the latest evaluation reason; Ctrl+O reveals the reason in the transcript.
The page documents support in interactive sessions, non-interactive mode, the desktop app and Remote Control. In non-interactive mode, setting a goal through -p runs the loop within one invocation. Adding --output-format stream-json --verbose exposes messages while it runs; default text output prints the final response when the loop ends.
An active goal is restored when its session resumes, but its turn count, timer and token-spend baseline reset. Achieved or cleared goals are not restored.
Using it
Requirements
Availability follows the workspace trust rule used for hooks in settings files. The command is unavailable when the effective disableAllHooks setting is true or managed settings enable allowManagedHooksOnly.
A goal preserves the existing permission mode. In Manual mode, commands outside existing permissions can still require approval. The guide recommends auto mode for unattended turns.
Installation steps, supported operating systems, account eligibility and a minimum version for basic /goal support are not established by this page. Several related behaviors have explicit version requirements.
Mechanism
The command wraps a session-scoped prompt-based Stop hook. After a completed turn, Claude Code sends the condition and conversation to the configured small fast model on the session’s provider. That evaluator cannot call tools, run commands or read files independently.
The evaluator returns a verdict and reason. An unmet condition triggers another working turn with that reason as guidance. A met condition clears the goal and records achievement. An impossible verdict clears it and records failure; this is the evaluator’s judgment of impossibility.
Evaluation is deferred while a subagent or background shell command remains running. Completion of background work delivers a new turn. Check-ins can prompt Claude to inspect progress, wait or address stuck tasks.
Setup
Define one measurable end state, name the check that demonstrates it and state any constraints on changes. Send /goal followed by that condition; setting it starts work immediately. A turn or time clause can bound the intended effort, but the evaluator judges that clause from the conversation.
Use /goal without arguments to inspect status and /goal clear to remove an active goal. The aliases stop, off, reset, none and cancel also clear it. Starting a new conversation with /clear removes the goal. Ctrl+C interrupts a non-interactive run.
ANTHROPIC_DEFAULT_HAIKU_MODEL changes the evaluation model, but also affects the haiku alias, session title generation and other uses of the small fast model. CLAUDE_CODE_GOAL_CHECKIN_MINUTES changes the initial check-in interval; setting it to 0 disables both check-ins and automatic retries.
Example
The page gives this example: /goal all tests in test/auth pass and the lint step is clean. It illustrates a condition with two observable results, provided Claude runs the relevant checks and their output appears in the conversation.
The guide also suggests constraints such as leaving other test files unchanged and a stopping clause such as stopping after 20 turns. Repository-specific test and lint commands, execution output and a demonstrated successful result are not supplied.
Assessment & evidence
Limitations
The evaluator depends on evidence surfaced in the conversation. If Claude repeatedly answers without using tools, the loop can stop and return control while leaving the goal set; evaluation resumes after the next prompt. Completion accuracy and resistance to misleading or incomplete output are not assessed.
When Claude Code manages its own credentials, an authentication failure or a disk too full to renew the claude.ai login clears the goal; exhausted credits, a context overflow that auto-compaction could not clear and an unavailable model also clear it. After fixing the cause, the user must set it again. Host-managed authentication failures are treated differently because the host can restore access.
Other failures leave the goal set. In supported interactive versions, transient failures can trigger automatic retries, with a pause after three retries. Rate limits, usage limits and hook-ended turns can pause it directly. A session configured to wait for a usage-limit reset can resume automatically.
Background work delays evaluation. The default first check-in is after 30 minutes, followed by a check-in one hour later and then one every two hours. Non-interactive check-ins require a turn to end; interactive sessions can also start idle check-in turns, capped at three between user prompts.
Reasoning
The documented mechanism makes the quality of the completion condition especially important. Naming an actual test, build result or queue state gives the evaluator something concrete to judge. Stating constraints also makes clear what must remain true while Claude works.
A practical inference is that developers should inspect the underlying check results when deciding whether to accept the work. A separate evaluator can reconsider the working model’s conclusion, but it still depends on the conversation. The page provides no comparative evidence that this arrangement improves correctness or reduces supervision.
Alternatives
The page compares /goal with /loop, which starts another turn after a time interval, and a configured Stop hook, which runs after turns and can use a script for deterministic checks or a prompt for model-based checks. A configured hook persists within its settings scope; /goal applies to the current session.
Auto mode handles tool approvals within a turn. Combining it with /goal also allows subsequent turns to start automatically. For work independent of an open session, the page points to cloud and Desktop scheduling options.
These comparisons are described on the selected page. The linked setup guides and their additional requirements are outside the available evidence.
Evidence
The evidence is the complete documentation page at [https://code.claude.com/docs/en/goal.md]. It supports the command syntax, stated operating behavior, configuration effects, restrictions and version-specific notes.
The captured source has SHA-256 identifier 9f76fc8fc67771b934c70401dbb423ee25f2e52c8aa762871f9c7b0a81bd8739. It contains explanatory examples rather than execution receipts or benchmarks. Nothing was executed, and the documented behavior has not been independently verified.
Access & freshness
Costs
Evaluation tokens are billed using the small fast model configured for the session’s provider. The page describes these charges as typically small compared with main-turn spend, but supplies no rates or measured totals.
The practical cost implication is that continued working turns can add model usage alongside evaluation usage. Exact costs, subscription requirements, included allowances and provider-specific charges are unknown from this page.
Status reports token spend, but its baseline resets on session resumption. The documented turn and time clauses are model-evaluated; the page does not establish a hard spending cap.
Rights
The selected page supplies no documentation license or redistribution permission. Claude Code software licensing terms and rights in generated outputs are also not established here. Those rights remain unknown within this source.
Freshness
The page was captured on 15 November 2026 at 02:26:18.132 UTC. That timestamp identifies the snapshot; it does not establish the page’s publication date, last revision date or the latest Claude Code release.
The page specifies check-ins from v2.1.234 and interactive idle check-ins from v2.1.236. It identifies v2.1.239 changes to resume restoration and check-in timing, and v2.1.246 as the boundary before which idle check-ins were uncapped.
Interactive automatic retry and pause notices are documented for v2.1.269 or later. Readers should compare these version gates with their installed version; behavior on any installation is unverified.
Actions
Start with a bounded task whose completion can be shown by actual command output. Put the desired result, proof command and change constraints into the condition, then run /goal with no arguments to check status, and read the evaluator’s most recent reason to monitor progress.
Check the installed version, hook settings and permission mode before relying on unattended work. Treat a time or turn clause as an evaluated instruction, and use /goal clear when you need to remove the goal.
Review the underlying outputs before accepting completion. Check provider pricing separately, and remember that resuming a session resets the displayed timing, turn-count and token-spend baselines.
