Claude Code Goal Mode: the /goal Command for Beginners

Claude Code goal mode explained simply: set a finish line with /goal and Claude keeps working, turn after turn, until an independent checker says done.

claude codegoal mode/goalautonomous agentsbeginners
↻ Updated 2026-10-07EAEvgenii ArsentevEvgenii Arsentev · PhD

Reviewed for accuracy by Evgenii Arsentev, PhD · 2026-10-07

Goal mode is the /goal command in Claude Code: you describe a completion condition once, and Claude keeps working toward it turn after turn without you prompting each step. After every turn a small fast model checks whether the condition is met — if not, Claude starts another turn; if yes, the goal clears itself; and if the model decides the condition can never be satisfied, it clears the goal too and tells you why, instead of looping forever.

I'm Evgeny, and this is my favorite feature to show non-programmers, because it fixes the most exhausting part of working with AI: babysitting. Normally Claude finishes a turn, declares victory, and waits for you to notice it's only half done. With /goal, a separate referee — not the model doing the work — decides when it's actually finished.

What does the /goal command actually do?

Run /goal followed by your condition, and a turn starts immediately — the condition itself is the instruction, no separate prompt needed. While it runs, a ◎ /goal active indicator shows how long it's been going. After each turn the evaluator returns a short reason why the condition is or isn't met yet, and that reason guides Claude's next turn. One goal can be active per session; setting a new one replaces the old.

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

Straight from the official docs, and a perfect template: a measurable end state plus a way to prove it. Claude will run, check, fix, and re-check until the referee agrees.

What does a good goal look like? (examples)

The evaluator doesn't run commands or read files itself — it only judges what Claude has surfaced in the conversation. So phrase the goal as something Claude's own output can demonstrate. A condition that survives many turns has three parts: one measurable end state (a test result, a file count, an empty queue), a stated check ("npm test exits 0"), and any constraints that must hold on the way ("no other test file is modified"). You get up to 4,000 characters — enough for real acceptance criteria. For a non-programmer site project, try: "the site builds without errors, every page has a title and description, and the contact form sends — prove each with a command — or stop after 20 turns."

How do I stop a goal from running forever?

✦The safety clause nobody mentions

A goal runs until the condition is met or you clear it — there is no built-in turn cap. The docs' own trick: write the limit into the condition, like "or stop after 20 turns". Claude reports progress against that clause and the evaluator enforces it. Cheap insurance against a very persistent robot.

How does Claude know the goal is reached?

Under the hood, /goal is a wrapper around a prompt-based Stop hook scoped to your session. Each time Claude finishes a turn, your condition plus the conversation so far go to your configured small fast model (Haiku by default), which returns one of three verdicts with a short reason: not yet met sends Claude back to work with the reason as guidance; met clears the goal and records an achieved entry; and impossible clears the goal too, with a failed entry explaining why, so a condition that can't be satisfied doesn't run forever. Evaluation tokens are billed on that small model and are typically negligible. Why this matters: completion is decided by a fresh model, not the one grading its own homework.

How do I check status or stop a goal?

Run /goal with no arguments to see the condition, how long it's been running, turns evaluated, token spend, and the evaluator's latest reason. To stop early, run /goal clear — stop, off, reset, none, and cancel work as aliases. If a session ends with a goal still active, resuming it with --resume or --continue restores the condition (the counters reset). And /goal works non-interactively too: claude -p "/goal CHANGELOG.md has an entry for every PR merged this week" runs the whole loop in one command.

Check in, or pull the plug
/goal

No arguments = status report. To cancel before the condition is met: /goal clear. Starting a new conversation with /clear also removes the active goal.

Goal mode vs /loop vs auto mode — what's the difference?

Three things sound similar but answer different questions. /goal starts the next turn the moment the previous one ends, and stops when a model confirms your condition. /loop re-runs on a time interval and stops when you stop it or Claude decides the work is done. Auto mode doesn't start new turns at all — it approves tool calls within a turn so Claude isn't pausing to ask permission. The docs call /goal and auto mode complementary, and that's the practical combo: auto mode removes per-tool prompts, /goal removes per-turn prompts.

What do I need before /goal works?

One requirement to remember: /goal needs Claude Code v2.1.139 or later — run claude update if the command isn't there — and a workspace where you've already accepted the trust dialog, since the evaluator rides on the hooks system. Get those two right and the command is available everywhere a normal session is.

Lab: your first supervised marathon

0/5

The kicker: tonight, before closing the laptop, give Claude one /goal with a verifiable finish line and a turn cap. Waking up to a completed checklist — judged by an independent referee, not by the worker's optimism — is the moment goal mode stops being a feature and becomes a habit.

Free course

Stop reading about AI — start building with it

The free Claude Code course: your first site, tool or game — no coding. No upsells, no cross-sells — nothing to buy here.

Start free →

References

Selected peer-reviewed papers and preprints on the AI research behind this topic.

  1. [1]Wang et al. (2024). Learning From Failure: Integrating Negative Examples when Fine-tuning Large Language Models as Agents. arXiv:2402.11651
  2. [2]Guo et al. (2023). Learning to Plan with Natural Language. arXiv:2304.10464
  3. [3]Mao et al. (2023). A Language Agent for Autonomous Driving. arXiv:2311.10813
  4. [4]Rothfarb et al. (2025). Hierarchical Multi-agent Large Language Model Reasoning for Autonomous Functional Materials Discovery. arXiv:2512.13930
  5. [5]Toghi et al. (2021). Altruistic Maneuver Planning for Cooperative Autonomous Vehicles Using Multi-agent Advantage Actor-Critic. arXiv:2107.05664
  6. [6]Sonu et al. (2015). Individual Planning in Agent Populations: Exploiting Anonymity and Frame-Action Hypergraphs. arXiv:1503.07220
  7. [7]Li et al. (2023). Model-free Motion Planning of Autonomous Agents for Complex Tasks in Partially Observable Environments. arXiv:2305.00561
EAEvgenii Arsentev

Author

Evgenii Arsentev

PhD · Chief Executive Officer, digital health

Reading is a good start

Want to actually build this?

Guides explain. The free course transforms — personalized, gamified, and built to get you shipping fast.

Start the free course →