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.
/goal — Keep Working Until Done
Section titled “/goal — Keep Working Until Done”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| Command | Effect |
|---|---|
/goal <condition> | Set (replaces existing) and start working immediately |
/goal | Status: condition, elapsed time, turns, token spend, last evaluator reason |
/goal clear | Stop early (aliases: stop, off, cancel) |
Also works headless — runs the whole loop in one invocation:
claude -p "/goal CHANGELOG.md has an entry for every PR merged this week"Writing conditions that work
Section titled “Writing conditions that work”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”
Goal vs loop vs Stop hook
Section titled “Goal vs loop vs Stop hook”| Approach | Next turn starts when | Stops when |
|---|---|---|
/goal | Previous turn finishes | Evaluator model confirms condition |
/loop | Time interval elapses | You stop it / work judged done |
| Stop hook | Previous turn finishes | Your 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).
Advisor — a Stronger Model on Call
Section titled “Advisor — a Stronger Model on Call”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 # disableclaude --advisor opus # one sessionOr in settings: { "advisorModel": "opus" }
Pairing rule: advisor must be ≥ the main model. Popular combos:
| Pairing | Why |
|---|---|
| Sonnet main + Opus advisor | Cheap routine work, strong plans — the sweet spot |
| Sonnet main + Fable advisor | Fable-quality decisions without Fable-priced typing |
| Haiku main + Opus advisor | Lowest cost with a safety net |
| Fable main + Fable advisor | Only 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 turnsSonnet 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.
🧠 Quick Recall
Section titled “🧠 Quick Recall”- Trick: “Goal = don’t stop until proven. Advisor = phone a stronger friend.”
👨🏫 Teach It
Section titled “👨🏫 Teach It”- Show:
/goal all tests passon 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