Skip to content

Goal & Advisor — Autonomy and Second Opinions

Two power features for long tasks: /goal keeps Claude working until a condition is verified true, and the advisor gives Claude a stronger model to consult at decision points.

Set a completion condition; after each turn a small fast model (Haiku) checks the conversation — if the condition isn’t met, Claude starts another turn instead of stopping.

/goal all tests in test/auth pass and the lint step is clean
CommandEffect
/goal <condition>Set (replaces existing) and start working immediately
/goalStatus: condition, elapsed time, turns, token spend, last evaluator reason
/goal clearStop early (aliases: stop, off, cancel)

Also works headless — runs the whole loop in one invocation:

Terminal window
claude -p "/goal CHANGELOG.md has an entry for every PR merged this week"

The evaluator only sees the conversation — it can’t run commands itself. So the condition must be provable by Claude’s own output:

  • ✅ One measurable end state: “npm test exits 0”, “the queue is empty”
  • ✅ A stated check: how Claude proves it
  • ✅ Constraints: “no other test file is modified”
  • ✅ A bound: “…or stop after 20 turns”
ApproachNext turn starts whenStops when
/goalPrevious turn finishesEvaluator model confirms condition
/loopTime interval elapsesYou stop it / work judged done
Stop hookPrevious turn finishesYour script/prompt decides

/goal pairs perfectly with auto mode (approves tools within a turn) — goal removes per-turn prompts, auto mode removes per-tool prompts. Requires hooks to be enabled (goal is a session-scoped prompt-based Stop hook under the hood).

Claude consults a second (usually stronger) model at key moments: before committing to an approach, when an error keeps recurring, before declaring done. The advisor sees the full conversation and returns guidance.

Experimental, v2.1.98+, Anthropic API only.

/advisor opus # set + save as default
/advisor off # disable
claude --advisor opus # one session

Or in settings: { "advisorModel": "opus" }

Pairing rule: advisor must be ≥ the main model. Popular combos:

PairingWhy
Sonnet main + Opus advisorCheap routine work, strong plans — the sweet spot
Sonnet main + Fable advisorFable-quality decisions without Fable-priced typing
Haiku main + Opus advisorLowest cost with a safety net
Fable main + Fable advisorOnly Fable can advise Fable

You’ll see an Advising line in the transcript (Ctrl+O to read the guidance). Ask for consultations explicitly anytime: “consult the advisor before you continue.” Toggling the advisor does not invalidate the prompt cache (unlike switching models).

Real Case: Overnight Migration With Guardrails

Section titled “Real Case: Overnight Migration With Guardrails”
/advisor opus
/goal every usage of the legacy Logger class is migrated to structlog,
npx tsc --noEmit exits 0, npm test exits 0, and no file outside src/
is modified — or stop after 40 turns

Sonnet grinds through the mechanical edits; Opus gets consulted when a weird generic type blocks progress; the goal evaluator refuses to let the session declare victory until the compiler and tests actually agree.

  • Trick:Goal = don’t stop until proven. Advisor = phone a stronger friend.”
  • Show: /goal all tests pass on a repo with 2 failing tests — watch it grind to green.
  • They’ll trip on: conditions the evaluator can’t verify from the transcript — include the check command.

Learning path:48-computer-use.md · Index · ➡ 50-agent-view-and-workflows.md

Written by Fenil Patel