What this thread does
The problem
Claude Code finishes a turn, reports progress, and waits. For a migration or a bug with a clear pass or fail check you end up typing "continue" every few minutes, or it declares victory with failing tests.
What /goal does (Anthropic docs, read 17 November 2026)
/goal <condition> starts a turn right away and, after each turn, sends the condition plus the conversation to your small fast model. Verdicts: not yet met (Claude continues, using the reason as guidance), met (goal cleared), or impossible (cleared with a reason). One goal per session; /goal shows status (turns evaluated, token spend, last reason) and /goal clear removes it. It also works with claude -p "/goal ...", in the desktop app and through Remote Control, and active goals are restored on resume.
Writing a condition that works
The evaluator judges only what Claude has shown in the conversation; it does not run commands itself. The docs recommend one measurable end state, a stated check, and constraints. Example: /goal all tests in test/auth pass and the lint step is clean, and no other test file is modified, or stop after 20 turns. Put a turn or time clause in to bound it (up to 4,000 characters).
Things to know
- A goal does not change permissions. For unattended runs the docs pair it with auto mode; in Manual mode Claude still asks before commands your settings do not allow.
- It stops by itself if Claude makes no tool calls for several turns, leaving the goal set, or clears the goal on errors you must fix (authentication or a disk too full to renew login when Claude Code manages its own credentials, no credits, context overflow auto-compaction cannot clear, unavailable model). Host-managed authentication failures leave the goal active. Usage limits and overloads pause or retry instead.
- Long goals spend plan usage; while background work is running it checks in at most three idle times per goal between your prompts (
CLAUDE_CODE_GOAL_CHECKIN_MINUTES=0turns off check-ins and automatic retries). - A Stop hook is the alternative when you want a deterministic script check instead of a model judging.
Caveats
- Vendor documentation; WhatWorks has not run goals. The evaluator can be wrong in either direction, so keep a real check (tests, build) in the condition.
Sources
Primary source: the Claude Code /goal docs, read in full on 17 November 2026.
- Confirms: the three verdicts from a small fast model, one goal per session,
/goalstatus and/goal clear, non-interactive, desktop and Remote Control use, restoring an active goal on resume, conditions of up to 4,000 characters, the evaluator judging only what Claude surfaced in the conversation, pairing with auto mode for unattended runs, the stop after several turns without tool use, the five error kinds that clear the goal, with authentication and login-renewal disk errors scoped to Claude Code-managed credentials, and the Stop hook alternative. - Corrected above: the docs say Claude Code starts at most three idle check-ins per goal between your own prompts, and
CLAUDE_CODE_GOAL_CHECKIN_MINUTES=0turns off both check-ins and automatic retries. The evaluator model is the small fast model, so settingANTHROPIC_DEFAULT_HAIKU_MODELchanges it (and other background work).
Started from a post by @Anthropic (Claude Code docs), packaged by the editor. Original post