The master setup prompt
One /goal prompt that sets up models, skills, subagents, a verify skill and a review checklist.
How to use it
- Update Claude Code with claude update, then start it in your project folder.
- Copy the prompt below with the button.
- Paste it into Claude Code and press Enter. Answer the questions it asks about your work.
- Read the final report. Run /clear before your next task.
/goal Set up this machine and project for an effective, token-efficient multi-agent Claude Code setup that follows Anthropic's guidance at code.claude.com/docs (model-config, sub-agents, workflows, advisor, prompt-caching, costs, best-practices, plugins). Done when steps 1-9 are complete AND your final message shows evidence for each.
Rules: back up every file before changing it (FILE.bak-YYYYMMDD). Merge into existing settings; never delete my keys. Only touch ~/.claude and this project. Ask me before installing anything. If my plan lacks Fable, use opus where fable is named.
1. Run `claude --version`. If below 2.1.296, tell me to run `claude update` and stop.
2. ~/.claude/settings.json: merge "model": "opus", "advisorModel": "fable", "fallbackModel": ["sonnet","haiku"], env CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL=sonnet and CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH=2. Never set CLAUDE_CODE_SUBAGENT_MODEL. Validate and print it.
3. Ask me which areas I work in, then install only those skill packs (skills load on demand). First add marketplaces anthropics/knowledge-work-plugins and anthropics/skills.
- Apps/engineering: code-review, feature-dev, commit-commands, security-guidance @claude-plugins-official; engineering@knowledge-work-plugins; the code-intelligence plugin for my language
- Web design: design@knowledge-work-plugins; example-skills@anthropic-agent-skills (frontend-design, webapp-testing)
- AI agents: example-skills (mcp-builder, skill-creator) plus built-in /claude-api
- Company: product-management, small-business, finance, legal, operations @knowledge-work-plugins
- Marketing, sales, data: marketing, sales, data @knowledge-work-plugins
4. ~/.claude/agents/: one-line descriptions, short prompts, skill names exactly as installed:
- Explore: haiku; disallowedTools Write, Edit, NotebookEdit; autoCompactWindow 100000; omitClaudeMd true
- test-runner: haiku; tools Bash, Read, Grep, Glob; autoCompactWindow 100000; reports only failures
- verifier: opus; effort high; read-only; memory project; checks a finished change against the request
- code-reviewer (apps pack): opus; effort high; read-only; skills: the engineering code-review skill
- ui-reviewer (web pack): sonnet; read-only; skills: frontend-design, design-critique, accessibility-review
- web-tester (web pack): haiku; skills: webapp-testing
Do not create one agent per business area; those skills load on demand in any session.
5. If this is a project: CLAUDE.md under 200 lines (purpose, commands, gotchas, non-default conventions). Add "When compacting, keep modified files and test commands." and "For key judgment calls, show me the options and the strongest case against your pick before deciding." Move procedures over ~10 lines into skills. Print the line count.
6. .claude/skills/verify/SKILL.md with the exact commands that prove a change works here. Run them once.
7. REVIEW.md: what a real bug looks like here, paths to skip, a cap on nits, file:line evidence required.
8. If there is a test command, add a PreToolUse hook that filters test output to failures (pattern in docs/en/costs). Test it.
9. Final report: merged settings, installed plugins, each agent's frontmatter, CLAUDE.md line count, files added, and a cheat sheet: Opus 5.5 medium is default; /effort high to verify; change effort, not models, mid-task; "ultracode:" for big fan-outs; /model fable for the hardest tasks; /clear between tasks, /compact at breaks, /usage weekly.
Skip 5-8 if this is not a project. Stop after 40 turns and report what is left.Our master setup prompt is a single /goal you paste into Claude Code. It configures your models, installs the skill packs you need, creates a small team of subagents and tidies your project files. This guide explains every step, so you know exactly what it will touch before you run it. The full text lives at /master-prompt.
What you will have at the end
- A clear picture of what each of the nine steps changes on your machine
- A user settings file with a default model, an advisor and a fallback chain
- Only the skill packs that match the work you do
- Read-only reviewer and explorer agents that report back instead of editing
- A short CLAUDE.md, a verify skill and a test-output filter in your project
Before you start
- Claude Code installed and signed in. If not, start with Start here.
- Version 2.1.296 or newer. Several pieces the prompt uses, such as the
autoCompactWindowagent key, need it (sub-agents). - A project folder with git, so you can review the diff afterwards.
Step 1: Understand the wrapper
The prompt opens with /goal followed by a long condition. A goal keeps Claude working across turns: after each turn, a small fast model checks whether the condition holds, and if not, Claude starts another turn (goal docs). The condition can be up to 4,000 characters, which is why the whole prompt fits in one goal.
The docs say a good condition has one measurable end state, a stated check and the constraints that matter. Our prompt maps to that directly. The end state is "steps 1-9 are complete". The check is that the final message shows evidence for each step, which matters because the evaluator only judges what Claude has shown in the conversation and does not run commands itself. The last line, "Stop after 40 turns", is the turn bound the goal docs recommend adding.
The rules line sets the constraints: back up every file before changing it, merge settings instead of replacing them, only touch ~/.claude and the current project, and ask before installing anything. Run it in manual mode the first time and you will approve each action yourself. A goal does not change your permission mode.
Step 2: Version check (prompt step 1)
The first thing Claude does is run claude --version and stop if you are below 2.1.296, telling you to run claude update. This protects you from half-applied settings that an older version would ignore.
Step 3: Models in user settings (prompt step 2)
Claude merges these keys into ~/.claude/settings.json, the user file that applies to you in every project (settings):
"model": "opus". Theopusalias points to the latest Opus, which on the Anthropic API is Opus 5.5 (model config)."advisorModel": "fable". The advisor is a stronger model Claude consults at key moments, such as before committing to an approach or when stuck on a recurring error (advisor). For an Opus 5.5 main model, accepted advisors are Fable or Opus 5 and later. The advisor is experimental and needs the Anthropic API. If your plan lacks Fable, the prompt tells Claude to useopusinstead."fallbackModel": ["sonnet","haiku"]. When the main model is overloaded or unavailable, Claude Code tries these in order for that turn only (fallback chains).
It also sets two environment variables in the env block. CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH=2 limits how many layers of subagents can sit below your main conversation. The default is 3 (env vars), so 2 keeps nesting shallower and cheaper. CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL=sonnet runs workflow agents on Sonnet while your other subagents keep their own models. That variable arrived in 2.1.296 according to the changelog, though the env vars page does not list it yet.
The prompt says never to set CLAUDE_CODE_SUBAGENT_MODEL. Since 2.1.251 that variable is only a default for agents with no model of their own (sub-agents), so it is less risky than it used to be. We still leave it out, because each agent in step 6 names its model and one global default only blurs that.
Step 4: Skill packs by area (prompt step 3)
Claude asks what you work on, then installs only those packs. Skills load on demand, so unused packs cost little, but fewer is still easier to manage.
First it adds two Anthropic marketplaces, anthropics/knowledge-work-plugins and anthropics/skills. The official marketplace, claude-plugins-official, is added for you the first time you start an interactive session (Anthropic marketplaces). Adding one yourself looks like this inside a session:
/plugin marketplace add anthropics/knowledge-work-pluginsThen it installs plugins with the name@marketplace form, for example:
/plugin install commit-commands@claude-plugins-officialThat example comes from the plugin install docs. The prompt lists which packs go with apps, web design, AI agents, company work, and marketing, sales or data.
Step 5: A small agent team (prompt step 4)
Claude writes agent files to ~/.claude/agents/, which makes them available in all your projects (sub-agents). Each uses documented frontmatter keys:
modelpickshaiku,sonnetoropusper agent, so cheap jobs run on cheap models.disallowedTools: Write, Edit, NotebookEditmakes the Explore agent read-only.autoCompactWindow: 100000compacts an agent's context earlier. The allowed range is 100000 to 1000000.omitClaudeMd: truestarts the agent without your CLAUDE.md files, which keeps a search agent lean.memory: projectgives the verifier a persistent memory folder at.claude/agent-memory/<name>/.effort: highmakes the reviewer and verifier think harder than your session default.skillspreloads named skills into the agent at startup.
The prompt warns against one agent per business area. Those skills already load on demand in any session.
Step 6: Project files (prompt steps 5 to 8)
These run only inside a project.
Step 5 trims CLAUDE.md to under 200 lines, the target the memory docs give because longer files use more context and reduce adherence. It adds two lines we find useful: one about what to keep when compacting, and one asking Claude to show options and the strongest case against its pick on judgment calls. Procedures longer than about ten lines move into skills.
Step 6 creates .claude/skills/verify/SKILL.md with the exact commands that prove a change works in your repo, then runs them once. Step 7 writes a REVIEW.md that tells reviewers what a real bug looks like here.
Step 8 adds a PreToolUse hook that filters test output down to failures. The pattern comes from the costs page, where the hook rewrites a test command so only lines around FAIL or ERROR reach Claude. Less noise means fewer tokens per test run.
Step 7: The final report (prompt step 9)
The goal ends with a report listing merged settings, installed plugins, each agent's frontmatter, the CLAUDE.md line count and new files. It closes with a cheat sheet. Two items are worth knowing now. Opus 5.5 defaults to medium effort (model config). And including the keyword ultracode in a prompt asks Claude to run that task as a dynamic workflow (workflows).
Check it worked
- Run
/goalwith no argument after it finishes. It shows the achieved condition, its duration, turn count and token spend (goal docs). - Open
~/.claude/settings.jsonand confirm your old keys are still there next to the new ones. A.bak-copy should sit beside it. - Run
ls ~/.claude/agents/to see the new agent files. - In the project, run
wc -l CLAUDE.mdand expect a number under 200.
Common problems
The goal stops early with "Goal cleared after an unrecoverable error". Causes include an auth failure, an exhausted credit balance or a model that is not available. Fix the cause and run the goal again (goal docs).
Fable is not available on your plan. Fable can bill to usage credits on some plans (model config). Tell Claude to use opus for the advisor, as the rules line allows.
/goal is not available at all. It follows the same workspace trust rule as hooks and is off when disableAllHooks is true. Make sure you trusted the folder and check that setting (goal docs).
A plugin install fails with an unknown marketplace. Add the marketplace first, then install. On a fresh machine the official marketplace only appears after your first interactive session (discover plugins).
Next
- Write a CLAUDE.md that actually helps: what to keep after step 5 trims the file.
- The multi-agent orchestration playbook: a paid deep dive on the agent team this prompt starts.
Sources
- https://code.claude.com/docs/en/goal
- https://code.claude.com/docs/en/model-config
- https://code.claude.com/docs/en/advisor
- https://code.claude.com/docs/en/settings
- https://code.claude.com/docs/en/env-vars
- https://code.claude.com/docs/en/sub-agents
- https://code.claude.com/docs/en/changelog
- https://code.claude.com/docs/en/plugins/anthropic-marketplaces
- https://code.claude.com/docs/en/discover-plugins
- https://code.claude.com/docs/en/memory
- https://code.claude.com/docs/en/costs
- https://code.claude.com/docs/en/workflows
Last checked: 2026-11-06