CLAUDE CODE · 2026 · THE COMPLETE PLAYBOOKDWG NO. GP-HARNESS-01 · construction manual

The model is the fulcrum.
The harness is the lever.

Claude Code supplies the agent loop. The harness is the ring of context, tools, orchestration, and verification configured around it. With the same Claude, that configuration shapes how effectively it works. The 700K-line legacy-system case illustrates its practical role.

projectConfiguring the Claude Code harness sheetGeneral notes · floors 0–4 checkedfull-article structure and tone edit date2026-10-20 · editorial revision
fulcrum · selected model harness (you configure) output ceiling ↑ lever arm = floors 0–4, longer at every floor
GenAI Playbook · A consolidation of a dozen-plus Claude Code field notes · Principles, configuration, and operational reference in one place
Why build the harness first

Same model,
configuration shapes performance

Onboarding Claude like a new developer can get stalled work moving again, within the selected model's capabilities. For that model, the harness is the adjustable lever, the model the fixed fulcrum. Selecting a different model changes the fulcrum; configuring the harness adjusts the lever.

Two weeks
UW's Skyline: a feature shelved a year shipped in two weeks; a nightly-test module idle three years restarted in under a day
11 days
Bun ported Zig→Rust with the Workflow tool, ~750K lines, 99.8% test pass rate
43→84%
Switch from Sonnet 4.5 to Opus 4.6 under the same harness: compaction quality improves

A harness needs periodic pruning. As models improve, scaffolding that once helped can become unnecessary overhead. Each layer therefore involves a decision about what to retain and when to retire it.

Scope, stated up front

This piece is only about configuring Claude Code

Claude Code provides the main agent loop that Anthropic has already built. Configuring this framework does not require implementing that loop from scratch. The scope has three distinct parts: ① the capabilities of the selected model (Layer 0), ② the framework configuration covered here, and ③ building an agent from scratch, which is out of scope. Model selection belongs to configuration; the selected model's underlying capabilities are given.

▸ ②Configuring Claude Code (the subject)

Model selection, context management, the build order for knowledge and tools, orchestration with subagents and Workflows, pulling verification into its own role. These use Claude Code's existing framework and may include hook or Workflow scripts.

Plus ①model capability: the capability of the selected model — the bedrock (Layer 0).

▸ Out of scope: building an agent from scratch

prompt-caching design rules, implementing an MCP server, an agent-facing CLI, the single-loop vs. multi-agent trade-off, turning your product into a verifiable interface. Their implementation belongs to agent development or changes to external systems, outside this article's scope.

Where such material appears it's noted briefly and tagged "out of scope," not expanded.

The full blueprint · click any floor to jump

Five floors, configured as needed

0 · Foundation: model capabilitycapability depends on model 1 · Context: input, retention, cleanup5 branches 2 · Knowledge & tools: as neededCLAUDE.md → MCP 3 · Orchestration: who holds the plansubagent / Workflow 4 · Verification: generation ≠ evaluationindependent evaluator Case · onboarding 700K lines + Closing · build and prune reading order · capability to verification
The five floors organize model capability, context, knowledge and tools, orchestration, and verification. They provide a reading and configuration order, not a requirement to install every component in sequence.
0Sheet 00 · Foundation①Model capability · configuration starts here

Layer 0: model capability and cost

The selected model provides the foundation rather than something built through configuration. Its capabilities shape how much supporting structure the harness needs.

0.1The context window and context rot

The context window holds the system prompt, full conversation, all tool output, and files read. Its capacity is 1M tokens: as of October 2026, Fable 5.x, Opus 4.7 and later, Sonnet 5 and later, and Haiku 5.5 have 1M natively; older models have a 200K standard window. Capacity alone is not a reason to fill it.

window capacity noise share ↑ (old, irrelevant) usable attention / signal ↓ 0 tokens 1M tokens
An intrinsic property of attention, not a bug: longer context, lower signal-to-noise. 1M isn't for cramming everything in — it's for completing one task more reliably.

A context progress bar in the status line makes remaining capacity visible at a glance. It provides an ongoing view without repeatedly running /context:

claude — acme-monorepo
› refactor the payments service to use the new ledger client
● Read services/payments/ledger.ts (+2.1K tokens)
● Edit services/payments/charge.ts
…
~/acme-monorepo⎇ mainopus-5.5 · mediumcontext720K / 1M · 72%
That line is what the plugin adds to your status bar: remaining window, always visible. Past ~70–80% it warms from green to amber to red, nudging you to /compact or spin up a subagent — no more /context breaking your flow.
0.2Choosing the right model is itself harness design
A

Start from the model's default effort, then tune it against the work and the eval. In Claude Code, most effort-capable models default to high; the exceptions are Opus 5.5, Sonnet 5.5, and Haiku 5.5 at medium, and Opus 4.7 at xhigh. Anthropic's reasoning: in its testing, Opus 5.5 at medium matches or exceeds Opus 5 at high on coding and knowledge-work evaluations, and at a given level Opus 5.5 tends to think more per turn, so when moving from Opus 5, start at medium rather than carrying over the old level.

The levels are low, medium, high, xhigh, and max (Opus 4.6 and Sonnet 4.6 have no xhigh).

Use low and medium liberally as the primary controls for token cost and response time where quality holds, and step up to high or xhigh for demanding coding and agentic work. Reserve max for work that justifies unconstrained token spend; it still shows diminishing returns and can overthink.

Re-run the full effort sweep on the project's own evals for every new model rather than carrying settings forward. (Claude Code's default was xhigh on 4.7, back to high on 4.8, and down to medium on 5.5, which is exactly point D below.)

B

Confirm which settings you are actually on. Run /model and /effort once in a fresh session, since both remember the previous selection and that choice should be deliberate. When a session will be grunt work, MAX_THINKING_TOKENS=0 turns thinking off for that one session, the step below /effort low; on Opus 5.5, Sonnet 5.5, Haiku 5.5, and all Fable models thinking can't be turned off and the variable has no effect. The cache cost of switching model, and effort on older models, mid-conversation is in 0.4.

Beyond the five levels, /effort also offers auto, where Claude chooses per request; the slider also carries an Ultracode toggle, which is a setting rather than a level (see 3.7).

max burns through usage limits faster, so the guidance is to activate it per session, for hard debugging or architecture decisions. (In Anthropic's power-user tips collection, a Claude Code team member's personal take is to use Opus with thinking for everything: less steering and better tool use make it almost always faster overall than a smaller model. That is one engineer's experience with model selection; it does not conflict with the start-from-the-default, tune-on-your-evals guidance above, which is about effort on a given model.)

C
The thinking budget is adaptive. To push: "think carefully, step by step — this is harder than it looks." To speed up: "respond quickly, answer directly when uncertain."
D
Every generation changes its defaults. Prompts tuned for an older model need re-checking: response length, reasoning vs. tool calls, default subagent count all shift. Don't assume "strictly better" — every generation makes trade-offs. The table covers changes in default effort and long-context retrieval.
E
Delegate to Claude as an engineer, not a pair-programming partner. Each turn adds overhead, so authorize fully: in turn one, state intent, constraints, acceptance criteria, file locations; batch the work so it keeps moving.
Model snapshot · October 2026

As of October 2026, Claude Code's default model on Pro, Max, Team, Enterprise, and the Anthropic API is Opus 5.5 (released 22 September 2026, requires v2.1.280 or later; Anthropic says it performs at the level of Fable 5.1 on most work and costs 40% less than Opus 5). The docs list Fable 5.1 and Fable 5 as the most capable models in Claude Code, but neither is the default on any plan, and their usage may bill to usage credits.

Sonnet 5.5 (28 September) and Haiku 5.5 (7 October) shipped in the same cycle. Opus 5, released 24 July, was previously the Max default. These model names and defaults will change; the selection and evaluation principles remain applicable when they do.

What changedSpecificsWhat to do
Default effort changedClaude Code defaulted to xhigh on 4.7; 4.8 moved it back to high; 5.5 dropped it to mediumRe-run the effort sweep on your evals at each generation instead of carrying the old value
Long-context retrieval regressed (the 4.7 gen)Multi-needle MRCR: 256k 91.9%→59.2%, 1M 78.3%→32.2%; heavy web research fell too, BrowseComp ≈ −4.4ppRAG / long-doc / web-research: A/B before upgrading, don't trust the version number
0.3More reliable models can reduce verification rework

Over May and June 2026, we audited 11 reports using the same fact-check process: an independent subagent compared each claim with its source in a clean context, findings were corrected, and a fresh subagent reviewed the revisions until zero issues were found. Within this set of reports, the switch to Opus 4.8 coincided with fewer hallucinations and less verification rework:

before 4.8 after 4.8 avg audit rounds 3.2 1.2 first-pass clean 0/6 4/5
Even the most number-dense report (832 accounts / 13,873 observations / 33%→56% / r=0.28) passed first try, zero fixes. Hallucination rate directly sets the rework count.

The result was reduced rework, not "no verification after 4.8." Generation and evaluation remain separate responsibilities. The executor can run objective tests, while an independent agent reviews the work for acceptance rather than leaving the executor to declare its own work accepted (see Layer 4).

0.4How caching affects cost and quota

Token charges pay for inference: the GPU time needed to run the model over those tokens. Three factors determine that work: which model runs, whether a token is input or output, and whether it was cached. Section 0.2 covers model selection; the model's price applies across the categories below.

One tokenRelative to inputWhy
Input · prefillbaselineThe model reads everything you sent: system prompt, CLAUDE.md, your message, plus every file and command output already in the conversation
Output · decoderoughly 5xWritten one token at a time, so a 200-token response is 200 sequential runs of the model; per token, decode keeps the GPU busy far longer
Cache read0.1xThe server loads the already-computed state instead of recomputing it
Cache writeup to 2xThe state has to be retained afterwards — but the write happens once, and every later turn reads at 0.1x

In the following example, the prompt "fix the failing test in utils.test.ts." leads to five requests, each carrying the complete conversation so far:

History · cache read at 0.1x New this turn · full-price prefill Request 1 tool definitions + system prompt + CLAUDE.md + your message all written into the cache Request 2 reads utils.test.ts Request 3 reads the file under test Request 4 returns the Edit Request 5 runs the tests, output appended
Bar lengths are schematic, not measured proportions. The per-turn bill is cache reads on the history, full input price on what is new, and the output price on the response. A typical turn is lopsided: tens of thousands of tokens go in, a few hundred come out. Once the tests pass the model returns a short summary with no tool call, so there is no sixth request. Subscription pricing hides these line items, but the same requests draw down the plan's limits.

Cache reuse requires a byte-for-byte match from the start of the request. The order is stable: tool definitions, the system prompt, then the conversation with CLAUDE.md at its front. Appending a tool result at the end preserves the preceding content. A change earlier in the request can invalidate the cache for everything after it, as can a change to the cache key, the set of values used to determine whether the prefix counts as identical:

·
/model: every model has its own cache, so the next turn prefills the entire conversation at full price. This includes opusplan, which switches models on every entry to and exit from plan mode.
·
/effort: part of the key on most models, which is why a mid-conversation switch asks you to confirm. The exceptions are Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable 5.1: with an API key or a Claude subscription, changing effort keeps the cache and applies without asking (not on Bedrock, Google Cloud, a Claude apps gateway, or HIPAA configurations).
·
Fast mode: also part of the key, and the re-prefill happens at fast mode prices, so turn it on at the start. Turning it off again does not trigger a re-prefill.
·
/compact: the conversation is replaced with a shorter one, so nothing in it matches anymore; the system prompt in front of it survives.
·
Time: every turn resets the clock. On a subscription within plan usage the main conversation's cache lasts an hour; on an API key, a cloud provider, or a subscription drawing usage credits it lasts five minutes, and requests outside the main conversation (subagents, workflows, compaction) default to five minutes too. ENABLE_PROMPT_CACHING_1H=1 sets both to an hour; finer controls since v2.1.242 are promptCacheTtl and subagentPromptCacheTtl. Come back later than that and the next turn prefills everything again, which resuming an old session almost always does, since the cache is usually gone and the system prompt is rebuilt at launch anyway.

Anthropic treats a cache hit rate below its threshold as a production incident (SEV). Its account describes cache misses as requiring full-price recomputation, doubling cost and halving the plan's rate limit. Cache hit rate therefore directly affects the usable quota on a Pro/Max plan.

Model and effort changes remain available. When a change invalidates the cache, its cost depends on timing: the start of a session or immediately after /clear is a cheaper point to switch than the middle of a long conversation. The two rules below address that cost:

·
Don't switch models mid-conversation. Dropping a 100K-token Opus session to Haiku is more expensive (rebuilds the whole cache). Stay on the model, or spawn a subagent (own prefix chain, no pollution).
·
/compact while the window has room. Compaction reuses the parent prefix to avoid breaking the cache. Writing the summary is cheap while the old conversation is still cached, so compacting before you step away beats compacting after you come back. Reasoning in Layer 1.

For agents built from scratch, caching has 5 design rules: no mid-stream tool changes, defer_loading, no model switching, updates through messages rather than the system prompt, and compaction disguised as a parent continuation. These concern agent implementation and are out of scope here.

1Sheet 01 · Context②Configuring Claude Code

Context: input, retention, and cleanup

1.1Session cost: input, lifetime, and parallel contexts

Conversation content is sent again on subsequent turns. A file Claude reads or the output of a command it runs is included in each later request while it remains in the conversation. Here, a turn means a complete round trip from user or tool input to the model's response. Cached re-sends are inexpensive, but they are not free, and the content still occupies space the model must work with. A session's cost has three dimensions:

How much
How many tokens enter the context: the tool definitions, system prompt and CLAUDE.md that are there before you type, plus every file and command output after
How long
How many turns they stay. Turn 40 is also re-reading the 39 turns before it
How many
How many contexts run at once. A subagent moves noise out of the main window, at the cost of paying for its own turns

Run /context in a fresh session to inspect what is loaded at startup. Keep CLAUDE.md focused on specific instructions, move workflow-specific material into skills that load only when used, and turn off any MCP server the session does not need with /mcp. Most content added later comes from tool results. How much Claude reads depends in part on how much it must discover before doing the work:

Three ways to ask for the same fixWhat it costs
"The tests are failing"A grep or two to find which test, several files opened to see which is relevant, all of it staying in context long after it stops being useful
"Fix the failing test in utils.test.ts"Skips the search; costs one Read call
"Fix the failing test in @utils.test.ts"Drops the Read call too: @ attaches the file to your message before anything is sent, so it is in the very first request

The file occupies the same amount of context whether it is attached or read through a tool. Mention it once per conversation: @-mentioning it again on a later turn generally attaches a second copy.

Command output accumulates in the same way. Output from tests, a build, or a git log is appended to the conversation like a file Claude has read and remains for subsequent turns. How much of that output stays inline depends on the following threshold:

Over 30,000 characters

Written out to a file

Claude Code writes the output to a file and leaves only a preview of about 2,000 characters and the path in the conversation. To change how much stays inline, use the bashOutputMaxChars setting (v2.1.261+, up to 128,000); BASH_MAX_OUTPUT_LENGTH now sets the read-back window. Failed commands keep about 10,000 characters, as a head-and-tail excerpt.

Under the threshold

The lasting weight

A test runner that prints 400 passing tests one line at a time comes in under the limit, and those 400 lines are now part of every remaining turn.

Claude often reduces command output with flags and tail. For tighter control, the docs provide a small hook that rewrites noisy commands before execution so only relevant lines return. Put the two or three commands used throughout the day into CLAUDE.md, including their quiet flags, in the form they should run. For a single test file, for example, use npx vitest run --reporter=dot. This can save a turn and a few hundred lines of output in each subsequent session.

Keeping context across turns also has a cost. One long session costs more than the same work spread over a few short ones because later turns carry the earlier history. Use /clear when starting a new task and /compact when the earlier part of the same task is complete.

Use /rename before /clear if the session will be needed again. When using /compact, specify what to retain, or add a Compact instructions section to CLAUDE.md for recurring requirements. On a 1M model, /autocompact 200k restores the earlier auto-compact threshold. This requires Claude Code v2.1.221 or later; since v2.1.288, the value is saved per model.

Background turns carry context too. Each /loop execution is a full turn in the session where it was set up, carrying the entire conversation. If more than an hour has passed since the last turn, it also incurs a cache miss. Start a fresh session in another terminal for the loop. A /loop runs locally only, for up to 3 days at a time; work that must continue with the laptop closed can use /schedule, which runs in the cloud (see the official definition of a loop).

1.2When to continue or clear context

Claude Code provides the loop; context management controls what enters the conversation, what remains, and when it is cleared. Context is an important resource within the harness. After each step, there are 5 choices, 4 of them concerned with managing context quality:

step done Continuekeep the conversation, context unchanged /rewindroll back; keep reads, drop failed try /clearfresh session, carry your own notes /compactsummarize, then continue Subagentfresh window, returns conclusions only
Hover to trace each branch. "Continue" is the default; the other four are the levers for managing context.
1.3Compaction timing and what survives

Compaction replaces the conversation with a summary that the model uses to continue in a fresh window. It is lossy: some details are left out. The timing matters because automatic compaction fires near the context limit, when accumulated context may already have reduced the model's reliability:

session start context fills → model reliability (declines with context rot) ✓ proactive /compact in good shape, you know the next step ✗ auto-compact fires here high context load, critical summary
Typical failure: after a long debug, auto-compact summarizes the debugging; you say "fix that warning in bar.ts," but its details were dropped. Fix: use the 1M headroom and compact early, while in good shape.
1.4Rewind a wrong turn; branch to explore

Consider a session in which 5 files have been read, approach A has failed, and the next step is to try B.

Verbal correction

Failure and fix both linger

"That doesn't work, try B" — the failed approach plus your correction stay in context, adding noise and clouding judgment.

/rewind (double-tap Esc)

Back to the fork, switch cleanly

Roll back to "5 files read, A not tried," then say "don't use A — foo doesn't expose that interface, go to B." Keep the reads, drop the failed try.

The companion option "Summarize from here" condenses what Claude learned into a handoff note ("I tried A, it didn't work, because…"). A later session can use that record to avoid repeating the failed approach.

Rewinding also avoids the cost of rewriting the conversation. It removes turns from the end, leaving the preceding content cached; trimming those turns adds no cache-rebuild cost. By contrast, /compact generates a summary and replaces the conversation, so it always has a cost. If the last few turns are no longer useful, rewind to just before them rather than using /compact.

Forking preserves the current session while opening another direction. Rewind moves the current session back; /branch (or claude --resume <session-id> --fork-session from the CLI) copies it into a new branch and leaves the original untouched. It allows an uncertain approach to be tried without losing the current state.

1.5Choosing a session operation

/compact replaces the conversation with a summary; /clear clears it so the next task can start fresh. The practical distinction is who decides what to keep:

Dimension/compact/clear
EffortLow — Claude summarizesHigh — you distill
PrecisionClaude decides what to keepYou decide what to carry
Context rotPartly mitigatedPrior conversation cleared
Best forClearing clutter mid-taskStarting a fresh task
ScenarioUseWhy
Same task, context still relevantContinueIt's all still working for you
Claude went down the wrong pathRewindKeep reads, drop failed try
Session clogged with stale debug/compact + steerLow effort, you set direction
Starting a fresh task/clearOld conversation cleared; carry selected notes
Next step: lots of conclusion-only outputSubagentNoise stays in the child
Stepping away from the keyboard/compactCheap while the old conversation is still cached
Claude is mid-task and you have a quick question/btwSingle turn, no tool calls, full conversation context, doesn't interrupt
Try another direction but keep the current state/branchOriginal session untouched; the branch inherits context up to here

New task = new session. For related work, continue when the existing context remains highly relevant and avoids re-reading; otherwise, use /clear. For delegation, the useful question is "do I need the tool output itself, or just the conclusion?" A subagent can handle conclusion-only work in a separate context, as described in Layer 3.

That separation has a cost. Without the main conversation, a subagent may need to re-read material the main session already holds while paying for its own turns. For a small job, the overhead may outweigh the benefit, and the main session receives only what the subagent chooses to report. For a noisy job delegated repeatedly, give it a definition with model: haiku; otherwise, it runs on the main session's model.

2Sheet 02 · Knowledge & tools②Configuring Claude Code · core framework

Knowledge & tools: put each part in its place

2.1Start with a navigable codebase

Codebase setup shapes how effectively Claude can use its capabilities. The harness deserves attention alongside the model itself. Claude finds code through agentic search, exploring the live codebase with tools, rather than through retrieval-augmented generation (RAG) backed by an embedding index:

DimensionRAG toolsClaude Code · agentic search
Index upkeepNeeds an embedding pipelineNone
FreshnessLags (hours/days/weeks)Real time on the live codebase
Failure modeReturns deleted/renamed funcs, no signalNo such problem
ScalingCan't keep up with thousands of commitsEach instance runs independently

Agentic search needs enough starting context to know "where to begin," and navigation quality depends on setup quality. Investing in codebase setup helps teams get better results.

2.2Seven capabilities to configure as needed
base to extensions L1 · CLAUDE.mdauto-read L2 · Hooksself-evolve L3 · Skillsfocus here L4 · Pluginspackage & ship L5 · LSPadd-on L6 · MCPexternal systems L7 · Subagentsadd-on
Choose these seven capabilities as needed; they are not installation prerequisites for one another. Solid = five extension points; dashed = LSP / Subagents, two add-on capabilities. Starting in a subdirectory can focus the session while Claude still loads instructions from ancestor directories.
LayerMost common misuse
L1 CLAUDE.mdStuffed with reusable expertise (belongs in a skill)
L2 HooksDone via prompt instead of auto-running
L3 SkillsAll crammed into CLAUDE.md
L4 PluginsGood config left in one person's hands
L5 LSPAssumed automatic (needs a plugin + language server)
L6 MCPBuilt before the basics
L7 SubagentsExploring and editing in one session
2.3Where an instruction belongs

Section 2.2 groups the available configuration capabilities. Choosing where an instruction belongs is a separate question. Anthropic groups instruction carriers into seven kinds, distinguished by four factors: when an instruction loads, whether it survives compaction (the compression of session history), how much context it uses, and how much authority it carries.

Rules are a carrier for constraints: markdown files under .claude/rules/ can use a paths: field to load only when Claude touches a matching file. Without path scoping, a rule behaves like text in root CLAUDE.md: it is always loaded and always consumes tokens. The distinction therefore rests on paths. A convention for a single directory belongs in a nested CLAUDE.md; a cross-cutting constraint that applies across directories, such as "every handler validates input first", fits a path-scoped rule better.

---
paths:
  - "src/api/**"
  - "**/*.handler.ts"
---
All API handlers must validate input with Zod before processing.
Scoped to src/api/** → stays out of context in a docs-only session, loading only when Claude touches a matching file. That scoping is the whole of what makes Rules different from a root CLAUDE.md.
CarrierWhen it loadsSurvives compaction?Context costBest for
CLAUDE.md · rootSession start, always residentYes, re-read (memoized)High, every line costsBuild commands, codebase-specific gotchas, team norms
CLAUDE.md · subdirWhen a file under it is readGone until that dir is touched againLowA directory's local conventions
RulesWhen a file matching paths is touchedRe-injectedMedium (resident if unscoped)Cross-cutting local constraints
SkillsName resident, body loads on invocationRe-injected up to a shared budget, oldest dropped firstLowProcedural workflows
SubagentsName resident, body only when calledOnly the final summary returnsNear-zero in main contextIsolated side tasks, result only
HooksFire on lifecycle eventsBypass compaction entirelyLow, config lives outside contextActions that must happen deterministically
Output stylesSession start, into system promptNever compactedHigh, overwrites default system promptRole-level changes (use with care)
Append-system-promptCLI flag, that invocation onlyNever compactedMedium, cached after first requestTone, length, format preferences

The green column, "survives compaction?", describes whether an instruction remains available later in a long session. If compaction drops its carrier, the instruction may be absent afterward. A subdirectory CLAUDE.md, for example, remains absent until that directory is touched again.

Scenario A · launched at repo root
cwd = ~/project/
~/.claude/
CLAUDE.md
project/CWD
CLAUDE.md
CLAUDE.local.md
packages/
api/
CLAUDE.md
web/
CLAUDE.md
Scenario B · launched in a subdirectory
cwd = ~/project/packages/api/
~/.claude/
CLAUDE.md
project/
CLAUDE.md
CLAUDE.local.md
packages/
api/CWD
CLAUDE.md
web/
CLAUDE.md
Loaded at session startOn-demand (when a file under it is read)

The launch directory determines which CLAUDE.md files load at session start. User-level instructions in ~/.claude/ load at start, along with every CLAUDE.md / CLAUDE.local.md on the ancestor chain leading to the launch directory; files in directories below it load on demand. Launching in a subdirectory preloads the whole chain's conventions, bringing in local context while also increasing the starting context load.

System prompt
4.2K
Project CLAUDE.md
1.8K
Auto memory
680
Skill descriptions
450
User CLAUDE.md
320
Environment info
280
MCP tool descriptions
120
Before you type a single character, ~7.8K / 200K (~4%) is already loaded. The system prompt and project CLAUDE.md dominate, which is why keeping root under 200 lines matters; MCP and Skills load only descriptions at start (a couple hundred tokens each), with bodies entering on invocation. Figures are official illustrative values, not fixed.

Output styles and Append-system-prompt are best left unchanged in most cases. Output styles overwrite the default system prompt, removing "you are a software-engineering assistant" along with its safety and verification habits unless keep-coding-instructions: true is set. For style adjustments, check the built-in Proactive / Concise / Explanatory / Learning options first. Concise, a later addition, leads with the result and omits preamble and recaps. Append-system-prompt applies to one invocation and adds to the role, but instructions are followed less faithfully as more are piled on.

The "symptom → relocate" lookup starts with the content of an instruction rather than its carrier. Certain kinds of text in CLAUDE.md are signals that another location would fit better:

If you're writing this in CLAUDE.md…It belongs inWhy
"Every time X, always do Y" (run prettier after every edit, post to Slack on completion)a hook in settings.jsonThe model choosing to run a formatter is not the same as the formatter running automatically. If it must happen reliably, hand it to the harness instead of trusting the model to remember.
A 30-line procedure (deploy runbook, release or review checklist)a skill in .claude/skills/CLAUDE.md is for facts that are always true (build commands, codebase-specific gotchas, team conventions). A procedure's body loads only when invoked; leaving it resident just burns tokens.
A personal preference (e.g. "always use semantic commit messages")a user-level file (~/.claude/ or CLAUDE.local.md)Every file-based method has a user-level counterpart loaded across all repos. Keep personal taste at the user level; reserve project files for preferences that are team-wide but specific to this codebase.

Two further cases concern enforcement and scope. A "never do X" rule needs hooks plus permissions, with managed settings for org-wide enforcement. A constraint that applies only to src/api/** behaves like text in CLAUDE.md unless it has a paths: field.

Auto-memory and team conventions

Auto-memory supersedes the old # hotkey workflow by saving relevant work and user preferences automatically. Memories are written to ~/.claude/projects/<project>/memory/, with one directory per git repo root, separate from the hand-maintained ~/.claude/CLAUDE.md and ./CLAUDE.md. They are configured through /memory and consolidated through /dream, whose name refers to how REM sleep turns short-term memory into long-term storage.

Anthropic's power-user tips collection also retains the team's older habit: after a correction, tell Claude “Update your CLAUDE.md so you don't make that mistake again,” or tag @claude in a PR comment to add a review learning to CLAUDE.md. The integration is installed with /install-github-app; the team calls the practice Compounding Engineering. These approaches coexist. Specific conventions that repeatedly require correction across the team belong in the checked-in CLAUDE.md; personal preferences and scattered context go to auto-memory. The subtraction list targets broad defensive prohibitions, not individual corrections.

2.4Six practices for codebase navigation
1
Keep CLAUDE.md lean and layered: root global, subdir local, additive; root holds only pointers and key gotchas.
2
Initialize from a subdirectory, not the repo root: Claude walks up, loading every CLAUDE.md en route, so root context isn't lost.
3
Scope test/lint by subdirectory: else it changes one service but runs the whole suite — timing out, wasting context.
4
.ignore generated/build/third-party, and commit permissions.deny to version control for the whole team.
5
Build a codebase map when structure is unclear: a lightweight markdown at root, one line per top-level dir.
6
Run LSP to search by symbol, not string: filtering happens before Claude reads, not by opening hits one by one.
acme-monorepo/
├── CLAUDE.md root: pointers + gotchas only
├── .claude/
│   └── settings.json permissions.deny, checked in
├── apps/web/
│   ├── CLAUDE.md per-subdir test / lint
│   └── src/
├── services/payments/
│   └── CLAUDE.md init here, not at root
├── codebase-map.md directory-level index
└── (LSP: clangd) search by symbol, not string
The six practices aren't about "making Claude smarter" — they make the codebase easier to explore. Claude's ceiling in a big repo = its ability to find the right context.
2.5Skills: workflows and reference material

A skill is a folder, not just a SKILL.md file. SKILL.md is the entry point; scripts, references, templates and even the skill's own hooks can sit alongside it. These supporting resources let a skill provide more than prompt text alone.

my-skill/
├── SKILL.md entry: description = trigger
├── scripts/ reusable scripts to compose, not rebuild
├── references/ progressive disclosure, read on demand (api.md…)
├── assets/ templates, sample files
├── hooks/ intercept as needed, e.g. /careful blocks rm -rf
└── config.json user config; if unset, AskUserQuestion
The folder structure is the skill itself: SKILL.md gives the method, scripts/ the hands, references/ load on demand to save context.

Each skill's name and description sit in the system prompt, where they serve as triggers. Claude scans those entries, decides which skill to use, and issues an ordinary Bash call to cat the relevant SKILL.md into context. Referenced files such as references/api.md are read with a further cat only when needed. Claude pulls the skill body and its references on demand with general tools; the harness does not pre-inject that content.

Anthropic groups common skill uses into nine kinds, ranging from documentation lookup to operations:

Library / API ref
Product verification
Data analysis
Process automation
Scaffolding
Code review
CI / CD
Runbooks
Infra ops

Anthropic draws nine best practices from its hundreds of internal skills:

Authoring · first five

Getting a skill right

  • No filler: focus on what pushes Claude off its defaults (e.g. "avoid Inter and purple gradients")
  • Build a Gotchas section: the most valuable content — log failure points, keep updating
  • Progressive disclosure via the file system: split detail into references/api.md
  • Avoid over-constraining Skills, except in highly important areas; Description is the trigger, not a summary
Operations · last four

Keeping it durable

  • Store scripts for Claude to compose, not rebuilt boilerplate
  • Hooks on demand: /careful intercepts rm -rf, DROP TABLE
  • Persist in CLAUDE_PLUGIN_DATA (skill dirs are wiped on upgrade)
  • User config in config.json; if unset, ask via AskUserQuestion

Small teams can share skills by checking them into .claude/skills; a plugin marketplace with vetting supports wider distribution. A PreToolUse hook that logs invocations shows which skills are popular. Good skills can start as a few lines and improve as edge cases emerge.

Express specifications with concrete references

Rich references give Claude concrete material to work against. Anthropic identifies four forms: an HTML artifact created with Artifacts, a detailed test suite, a function in another codebase to port, and a rubric evaluated through dynamic workflows and verifier agents. The rubric lets Claude check judgment in a field against a standard, such as what good API design looks like. Anthropic favors executable or code-adjacent references over prose: "For example, a HTML mockup of a design will generally produce better results than a description of the design or a screenshot."

2.6Hooks: automation and permission boundaries

Hooks can attach to more than thirty events as of October 2026. Newer events include PostToolUseFailure, PermissionDenied, PreModelSwitch / PostModelSwitch, InstructionsLoaded, ConfigChange, and FileChanged. Since v2.1.295, a hook can set onFailure: "block" to block when the hook itself fails.

Anthropic's power-user tips collection singles out six patterns the team uses. PermissionRequest is particularly useful: it lets the approve-or-deny step itself be automated.

EventUse case
SessionStartDynamically load context each time you start Claude
PreToolUseLog every bash command the model runs
PostToolUseAuto-format code after Write/Edit to prevent CI failures
PermissionRequestRoute permission prompts to Slack, WhatsApp, or Opus for review
StopRun deterministic checks on long tasks, or nudge Claude to keep going
PostCompactRe-inject critical instructions after context compression
"PostToolUse": [
  {
    "matcher": "Write|Edit",
    "hooks": [{ "type": "command", "command": "bun run format || true" }]
  }
]
Auto-format on every edit; paste it into settings.json. The || true keeps a formatter failure from blocking the edit.

Anything written into CLAUDE.md, Rules, or Skills is an instruction, and an instruction is a request, not a guarantee. In a long session, an ambiguous moment, or a file carrying a prompt injection, the model can simply miss it. So for things that must never happen, dropping a database, editing prod, touching off-limits paths, a line that says "don't do this" isn't enough; only hooks and permissions enforce deterministically.

A PreToolUse hook can inspect a call and exit with code 2 to block it. At the enterprise level, managed settings are the only way to enforce an org-wide guardrail that a user's local config cannot override. A centrally MDM-deployed CLAUDE.md also cannot be excluded via claudeMdExcludes. Efficiency preferences belong in CLAUDE.md / Skills; hard safety boundaries belong in hooks + permissions. This parallels Layer 4's distinction between an executor running tests and independently judging whether the work meets acceptance criteria.
AGENTIC LOOP EACH TURN Setup opt-in SessionStart UserPromptSubmit PreToolUse blocking gate · exit code 2 denies the call PermissionRequest [ tool executes ] PostToolUse ·(+Failure) PostToolBatch SubagentStart / SubagentStop TaskCreated → TaskCompleted Stop / StopFailure wind-down TeammateIdle PreCompact → PostCompact SessionEnd resumed sessions OFF-SPINE / ASYNC EVENTS UserPromptExpansion slash commands Permission Denied auto-mode deny Elicitation + ElicitationResult MCP input Notification async ConfigChange async WorktreeCreate isolation WorktreeRemove teardown CwdChanged / FileChanged env reactive InstructionsLoaded async LEGEND main spine off-spine / async blocking gate session boundary tool exec wind-down

Hooks fire throughout the agentic loop, from SessionStart to SessionEnd. Each tool call follows the PreToolUse → tool executes → PostToolUse cycle. Hook configuration lives outside the main context and bypasses compaction entirely. PreToolUse provides a deterministic blocking gate: a hook that exits with code 2 denies the call. The dashed cluster on the right contains off-spine, asynchronous events that fire independently of the main flow.

2.7MCP: external tools and data

The Model Context Protocol (MCP) brings external data and systems into the session. On the consumer side, two client capabilities reduce context cost. Server design is outside this scope:

↓85%
Tool Search: with many tools, search on demand instead of preloading — tool-definition tokens drop ~85%, accuracy unchanged
↓37%
Programmatic Tool Calling: code loops over tool calls and filters and aggregates their results in a sandbox; only the final output enters context — ~37% less overhead
10 + 8
One real analytics plugin bundles 10 skills + 8 MCP servers — one install, generalist → domain expert

MCP and Skills are complementary: MCP supplies tools and data, while Skills supply the operating knowledge for using them. The five MCP-server design patterns fall outside this consumer-side scope.

2.8Maintenance: remove constraints that no longer help

Back in late 2024, Claude 3.5 Sonnet scored 49% on SWE-bench Verified with just two general tools, Bash and Text Editor — the SOTA then. Claude Code's foundation is still those two; Skills and Memory are combinations of them.

Tool schemas and overlong instructions take up context that could otherwise support reasoning. Before assembling an elaborate toolchain, check whether general tools can do the job.

Published alongside Claude Opus 5 on 24 July 2026, Thariq Shihipar's official Anthropic post, "The new rules of context engineering for Claude 5 generation models," provides evidence from Claude Code for reducing unnecessary constraints. For Opus 5 and Fable 5, Anthropic removed over 80% of the system prompt "with no measurable loss on our coding evaluations." Its diagnosis was explicit: "Overall, we found that we were overconstraining Claude Code, both through our system prompt and in our CLAUDE.md files and skills."

The transcripts show a cost beyond context capacity. A single request could inherit "leave documentation as appropriate" from one layer and "DO NOT add comments" from another. Even when Claude recovered the intended answer, it spent attention reconciling the overlapping constraints before acting. That reconciliation cost is distinct from the token cost of carrying the instructions at all.

A · System prompt size Was 100% Now <20% over 80% removed · no measurable loss on coding evals B · Conflicting instructions inside one request skill / CLAUDE.md / user request "leave documentation as appropriate" system prompt "DO NOT add comments" reconcile first paid in attention then act intent usually still recovered Capacity cost Schemas and prose crowd out the space the model uses to reason Attention cost Contradictory rules must first be read, weighed and traded off before any work ≠
When instructions from different layers land in one request, "leave documentation as appropriate" alongside "DO NOT add comments", Claude must reconcile them before choosing an action. Anthropic found that Claude generally reaches the intended answer, but overlapping constraints consume additional attention; the system prompt and its instruction files had become overconstrained.
ThenNowWhat changed
Give Claude rulesLet Claude use judgementMatch surrounding code; keep Skills flexible by default, with tight constraints only in highly important areas.
Give Claude examplesDesign interfacesExpressive parameters and typed states teach usage without narrowing exploration.
Put it all upfrontUse progressive disclosureFull definitions of built-in tools can also load on demand.
Repeat yourselfSimple tool descriptionsKeep usage guidance in tool descriptions rather than repeating it.
Memory in CLAUDE.mdAuto-memoryRelevant work and user preferences are now saved automatically.
Simple specsRich referencesArtifacts, tests, existing code and rubrics provide executable evidence of intent.

Progressive disclosure also applies to Claude Code's built-in tools. Anthropic says some tools use deferred loading: the agent must retrieve their full definitions through ToolSearch before use. The Task tools are its named example of what this makes affordable. The same mechanism used to withhold external MCP tool definitions in Section 2.7 also governs Claude Code's own tools. Anthropic also removed repeated instructions from the system prompt, judging tool descriptions sufficient to carry usage guidance without duplication.

Anthropic packaged this audit as claude doctor, exposed in Claude Code through /doctor, now a bundled skill with the alias /checkup. It provides an automated way to rightsize Skills and CLAUDE.md files by weighing unused skills, MCP servers and plugins against their context cost, checking CLAUDE.md for duplication and size, and identifying slow hooks. /doctor prompt-audit arrived in v2.1.283. The audit turns the six reversals into routine maintenance: build it, then cut it.

3Sheet 03 · Orchestration②Configuring Claude Code

Orchestration: who should hold the plan

Orchestration determines where the plan lives: in Claude's conversation, carried forward turn by turn, or outside it. The principle is to keep small tasks together and avoid making the model hold an entire large plan in context alone.

3.1Subagents: roles, types, and suitable tasks
3 traits / 3 built-in types

What it is

  • Three traits: fresh start (no history), parallel, permission isolation (research read-only / impl editable)
  • Nestable: a subagent can spawn subagents, by default up to three layers below the main conversation (adjustable with CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH), the structural basis for dynamic orchestration fanning one task across hundreds of agents
  • General-purpose: full tools, complex multi-step
  • Plan Agent: read-only, research + strategy
  • Explore Agent: read-only, fast search
5 scenarios

When to dispatch

  • Research-heavy (dozens of files)
  • Multiple independent tasks (parallel)
  • A fresh perspective (no inherited bias)
  • Pre-commit verification (independent check)
  • Pipeline workflow (clear stages/handoffs)
10+ files
Rule of thumb: consider delegation above this count
3+ subtasks
Rule of thumb: independent subtasks can run in parallel
3≈1
Ideal parallel case: three subagents take about as long as one
3.2Invocation and collaboration boundaries

Conversation first, automation later: start with natural-language requests, identify recurring patterns, and turn those patterns into reusable conventions and automation.

step 1
Conversational
Natural language; Ctrl+B to background
step 2
Custom subagent
.claude/agents/, description = a trigger
step 3
CLAUDE.md rules
Harden into standing conventions
step 4
Skills workflow
Reusable playbooks
step 5
Hooks automation
Most automated — e.g. a Stop hook blocking finish while tests fail
4 patterns

How it should be done

  • Research then implement (start from a summary, not 20 raw files)
  • Parallel batch edits (one pattern, independent files)
  • Independent code review (a fresh view is more objective)
  • Pipeline (design/implement/test, handoff via files)
5 anti-patterns

Don't do this

  • Sequentially dependent: one session in order is cleaner
  • Same-file edits: parallel edits collide
  • Tiny tasks: delegation has overhead, just do it
  • Too many expert agents: lowers auto-delegation reliability
  • Needing inter-agent coordination: they can't talk — use Agent Teams

A custom agent can serve as either a dispatched worker or the main conversation. claude --agent <name> starts a session with that agent's definition; adding "agent" to settings.json makes it the default. This effectively replaces the system prompt with a custom one. Each definition can specify its own color, tool set, allowed and disallowed tools, permission mode, and model. Anthropic's example restricts a read-only agent to the Read tool:

# .claude/agents/ReadOnly.md
---
name: ReadOnly
description: Read-only agent restricted to the Read tool only
color: blue
tools: Read
---

You are a read-only agent that cannot edit files or run bash.
3.3Parallelism: one worktree per session

Orchestration within a session is distinct from running several sessions at once. Anthropic's power-user tips collection, updated 2026-10-16 and gathered from individual engineers on the Claude Code team, calls parallel sessions the biggest productivity unlock: 3–5 Claude sessions in parallel, each in its own git worktree. Each session works in a separate working copy rather than editing the same files in a shared directory.

3–5
Parallel sessions the team runs, one worktree each
10
Parallel worktree subagents launched in Anthropic's example prompt
/batch
The next scale up: dozens or hundreds of worktree agents, each testing its own changes and opening its own PR
Entry pointHow
CLIclaude --worktree (or claude --worktree my_worktree); add --tmux to launch in its own tmux session
DesktopCode tab, check the worktree checkbox
Non-git VCSMercurial / Perforce / SVN: define WorktreeCreate and WorktreeRemove hooks in settings.json
SubagentsAdd isolation: worktree to the agent's frontmatter
# .claude/agents/worktree-worker.md
---
name: worktree-worker
model: haiku
isolation: worktree
---
Then prompt naturally: “Migrate all sync IO to async. Batch the changes and launch 10 parallel agents with worktree isolation. Each agent should test its changes end to end, then put up a PR.” At larger scale, /batch migrate src/ from JavaScript to TypeScript interviews you about the migration first, then fans the work out.

Several open sessions create a coordination problem: keeping track of which work is happening where. The team names its worktrees, uses shell aliases (za, zb, zc) to move between them, and color-codes terminal tabs. /color changes the prompt input color. Terminal notifications signal when a Claude session needs attention. Many engineers also keep a dedicated analysis worktree for reading logs and running queries.

Parallelism still assumes independent subtasks. A worktree prevents sessions from editing the same working copy; it does not remove sequential dependencies within the task (see the 3.2 anti-patterns). The collection therefore puts verification first: each agent needs a way to test whether its changes work for parallel execution to pay off.

3.4Permissions and sandboxing for long tasks

Parallel and long-running work benefit from fewer unnecessary permission interruptions. Allowlists, automatic approval, and sandboxing provide different controls. Reducing prompts still requires explicit permission boundaries.

control 1
/permissions
Pre-allow common safe commands, check into .claude/settings.json; the allowlist stays auditable
control 2
Auto mode
Classifiers evaluate each action; safe ones auto-approved, risky ones still flagged; Shift+Tab to switch
control 3
/sandbox
Open-source local sandbox runtime, file and network isolation, fewer prompts
control 4
dontAsk
Only in sandboxed environments: --permission-mode=dontAsk

The collection recommends pre-approving commands as an alternative to skipping permissions entirely. This reduces prompts while retaining an auditable allowlist. Full wildcard syntax is supported, including "Bash(bun run *)" and "Edit(/docs/**)". A small set of safe commands is pre-approved by default; entries added through /permissions extend that baseline. The permission system combines prompt-injection detection, static analysis, sandboxing, and human oversight.

/sandbox offers three modes: sandbox BashTool with auto-allow, sandbox BashTool with regular permissions, or no sandbox. Sandboxing, remote control, and scheduled cloud jobs are off by default and may be disabled by organization policy. A "not available" response usually means the administrator has not enabled the feature.

Long tasks · preferred

A Stop hook for deterministic checks

Preferred for auditable workflows. Alternatives: prompt Claude to verify with a background agent when done, or route permission requests to Opus via a PermissionRequest hook so it scans for attacks and auto-approves the safe ones (see 2.6).

Long tasks · with care

The community ralph-wiggum plugin

Not reviewed or sanctioned by Anthropic; check with your administrator before installing third-party plugins in a managed environment. Same for --dangerously-skip-permissions: sandboxed environments only.

As in 2.6, hard constraints are enforced through permissions and hooks, rather than instructions alone.

Layer 3 continued · Workflows and scripted calls

Orchestration: from delegation to scripts

3.5Workflows: the script holds the plan

The central distinction among Subagents, Skills, and Workflows is who holds the plan, represented by the PLAN token below. With a Subagent or Skill, Claude manages the plan turn by turn, and intermediate results enter its context. With a Workflow, the script manages the plan and intermediate results; the main Claude conversation receives only the final answer.

Subagent
Claude, per turn
CLAUDE CONTEXT ◆ PLAN { } SCRIPT
Plan in the head, every intermediate lands in context
Skill
Claude follows it
CLAUDE CONTEXT ◆ PLAN { } SCRIPT
Instructions are advice; the how is still per-turn
Workflow
the script
CLAUDE: final answer only { } SCRIPT ◆ PLAN
Loops/branches in the script, intermediates stay out
SubagentsSkillsWorkflows
Who decides nextClaude, per turnClaude, per promptThe script
Intermediates liveClaude's contextClaude's contextScript variables
ReproducibleWorker definitionInstructionsThe orchestration
ScaleA few per turnSame as subagentTens to hundreds/run
On interruptionRestart the turnRestart the turnResumable in-session

Workflows and Skills serve different, complementary purposes. A Skill changes "what the model knows," while a Workflow changes "how things are deterministically orchestrated." An agent dispatched by a workflow can load a skill before starting its task.

3.6Three failure modes in long-running work

The default harness keeps planning and execution in the same context. Long-running, massively parallel, or adversarial work can expose three failure modes in that arrangement, each of which provides a reason to move the plan into a script:

done! 35 / 50
agentic laziness
Laziness

A 50-item review claims "done" at item 35.

output self-grade ✓ all pass
self-preferential bias
Self-preference

It shields work it just produced when judging it.

don't X
goal drift
Goal drift

Fidelity leaks over turns; compaction drops "don't X."

Workflows reduce these three failure modes through their structure. For laziness, the script holds the full checklist and keeps the loop running until it is complete. For self-preference, verification goes to another independent agent. For goal drift, the goal remains in the script rather than depending on its survival through conversation compaction.

3.7Execution and runtime limits
1
Keeping intermediates in the script reduces context load and supports runs lasting hours or days. Coordination happens outside the conversation, so the plan no longer depends solely on conversation history.
2
Quality routines enforced as code, not left to the model to remember — "code forces every conclusion through N independent skeptics."
3
The whole orchestration can be saved and re-run: pick a run in /workflows, press s to save it as a command.
16
Default concurrent agents (fewer on machines with fewer cores; adjustable 1–256 since v2.1.269)
1,000
Max agents per run
0
User input you can inject mid-run
1
Resume only within the same session

Convergence provides the exit condition rather than a fixed round count. A workflow can be requested in a prompt with the keyword ultracode or wording such as "use a workflow", enabled through the Ultracode setting with /effort ultracode, or invoked through a saved command. There is also a built-in /deep-research command. A single parallel() or pipeline() call accepts at most 4,096 items.

As of October 2026, Workflows are available on all paid plans, through the Anthropic API, and on Bedrock, Google Cloud, and Microsoft Foundry. Pro users enable them in /config; organizations can disable them with "disableWorkflows": true in managed settings. Token use far exceeds that of a normal session. Start with a small task; before a large run, check /model and route lighter stages to a smaller model.

3.8Six composable orchestration patterns

Comparative judgment is more effective than absolute scoring, especially for ranking.

3.9The Bun migration: results and preconditions
⚠ The Bun case's preconditions, not to skip

A Workflow ported Bun from Zig to Rust: ~750K lines, 11 days, 99.8% test pass rate, via four chained workflows (① map Rust lifetimes ② translate per file, hundreds of agents in parallel, two reviewers each ③ drive build/tests to green ④ optimize overnight, a PR per change for human review). But the preconditions are extreme; not "any migration in 11 days":

  • strangler-fig incremental replacement, not a rewrite — Zig and Rust linked into one binary, switched class by class
  • every switch passed tests + shadow-diff + a ≤2% performance gate — verification-driven, not "done means trusted"
  • very high existing test coverage (99.8% presupposes a strong suite), single-author, not yet in production (99.8% isn't 100%)

Correct reading: on a high-value module with strong tests and gates, a deterministic script + build/test fix loop compresses quarter-scale work to days. Pilot on such a module; don't copy the timeline.

3.10Beyond coding: use cases and cost

Workflows also apply to non-technical work. Of the nine use cases named in the official guidance, over half do not involve writing code:

Migration / refactoringOne agent per change in its own worktree, another reviews adversarially, then merge
Deep researchNot just the web — also assembling a status report from Slack
Deep fact-checkingOne agent extracts every claim; a subagent per claim verifies and cites
RankingTournament / pairwise pipeline
Memory & rule-following
Root-cause investigation
Triage at scaleBrings out the quarantine pattern below
Taste-driven exploration
Model routing
🛡 quarantine isolation

An agent reading untrusted public content must not take high-privilege actions; those go to a separate set of agents. Reading and acting are kept apart — a structural defense against prompt injection.

When not to use it: Workflows use far more tokens than a normal session, and many tasks do not need the additional compute. The initial question is "does this really need more compute"; most traditional coding tasks don't need a five-person review panel.

A detailed prompt matters most. Small tasks can use a quick workflow; workflows can also be paired with /loop and /goal. The instruction use 10k tokens sets a token cap. Press s to save a workflow into ~/.claude/workflows or a skill, treating the saved version as a starting point for further refinement.

3.11Non-interactive runs: claude -p and --bare

Non-interactive runs need explicit configuration. By default, claude -p, along with the TypeScript and Python SDKs, searches for local CLAUDE.md files, settings, and MCP configurations. For use in scripts, continuous integration (CI), or SDK-based applications, the usual recommendation is to supply configuration through --system-prompt, --mcp-config, and --settings, then add --bare for roughly 10× faster startup:

claude -p "summarize this codebase" \
    --output-format=stream-json \
    --verbose \
    --bare
Anthropic calls this a design oversight from when the SDK was first built; a future version will flip the default to --bare. For now, opt in with the flag.

Explicit configuration supports reproducibility: a scripted Claude run should receive its configuration inputs on the command line rather than silently inherit a machine's personal configuration. For multi-repo work, --add-dir, or /add-dir within a session, grants access and permissions to additional folders. The team's settings.json can include "additionalDirectories" to make those folders available by default.

Cloud sessions and Claude Desktop also support a setup script that runs before each new cloud session to install dependencies, configure settings, and set environment variables. The script is skipped when a session resumes.

4Sheet 04 · Verification②Configuring Claude Code

Verification: self-testing and independent review

4.1Give the executor objective test feedback

Anthropic's power-user tips collection identifies this as its single most impactful practice: give Claude a way to verify its own output. Access to checks lets Claude iterate on the feedback rather than stop after generation. Those checks depend on the domain: bash commands, test suites, simulators, or browser testing. The investment is in verification suited to the work.

For frontend work, the collection describes two options. The Claude Code Chrome extension works in Chrome or Edge, and the team uses it whenever it works on web code. The Desktop app can start and test web servers in a built-in browser. The collection compares building a website without browser access to asking someone to build it without being able to see the result: it probably will not look good.

After changes, appending /simplify to the prompt runs parallel agents that review reuse, quality, efficiency, and CLAUDE.md compliance. The setup is covered in verification loops with skills.

PromptWhat it forces
“Grill me on these changes and don’t make a PR until I pass your test.”Claude validates your understanding before shipping
“Prove to me this works.”Claude diffs behavior between main and your feature branch
“Knowing everything you know now, scrap this and implement the elegant solution.”A clean redo after a mediocre first attempt
4.2Add independent acceptance review

As code becomes cheaper to generate, verification becomes a larger part of the work. Generation and evaluation have distinct responsibilities. An agent can run objective tests on its own output, but asking it to judge that output also exposes self-preference, much as a developer reviewing their own code may overlook its weaknesses. In this approach, tuning an independent Evaluator to be strict is easier than teaching the Generator to self-criticize. Independent review complements the Generator's self-testing.

spec · what deliver verdict · contract loop Plannerdefines what, not how Generatorbuilds in sprints Evaluatortests like a real user
The Evaluator drives Playwright, scores each criterion (one level editor had 27), catching real bugs like "fill tool fails because the function didn't fire on mouseUp." Design Quality / Originality are high-weight; Craft / Functionality are baseline.
▸ ②in scope here

Use an independent review subagent, or the Workflow adversarial-verification pattern, so reviewer ≠ executor and they share no context. This uses Claude Code's existing delegation and orchestration rather than rebuilding the agent loop.

▸ Only when it's your own product (out of scope)

Turn the artifact into an agent-readable interface (data-verify-* contracts, window.__verify, .verify.ts). The thesis is "an economic inversion": agents drive verification's marginal cost toward zero, so contract testing finally scales on the front end. You'd only do this when reshaping your own product.

Sheet 05 · Capstone · integration with an existing project

Onboarding a 700K-line legacy codebase

The Skyline project introduced at the opening brings all four layers together. Its core method is to onboard Claude like a new hire: provide enough background to complete a bounded project, then preserve what was learned as better context for the next round. The process follows a five-step loop, with each round building on the previous one:

↻ next round, higher start scope it provide context do the task distill context expand scope
As MacLean puts it, you wouldn't put a new hire in front of 700K lines on day one. Each task ends by writing what it learned back, so the next round starts higher.
UW · MacCoss Lab700K+ lines C#200K+ nightly testssince 2008 · 17 yrs
Context
Context lives in a separate repo pwiz-ai, not the code repo — else it's isolated by branch and Claude becomes a "different person" per branch. It is maintained and versioned as a real engineering artifact.
Knowledge
Skills follow "Reference, Don't Embed." The debugging skill is a hard trigger: must load on any bug/failure/anomaly, forcing root-cause analysis — no change-one-line-and-see.
Tools
Two MCP servers: a screenshot-diff server reproduces 2,000+ tutorial screenshots at near-100%, letting Claude "see" UI regressions; a daily-digest server feeds the failures from 200K nightly tests straight to Claude.
Two weeks
The Files View panel — shelved a year after its dev left — shipped, all commits co-authored
<1 day
The Java/LabKey nightly module, idle three years, restarted, incl. CSS he'd have hired a designer for
all 4 layers
A once-skeptical teammate built a panel on their own, too

Four takeaways from the Skyline case: isolate the scope, starting with a bounded task and expanding rather than attempting the whole legacy codebase at once; make the debugging skill a firm requirement, because blindly changing one line in 700K can trigger cascading failures; maintain context independently of code branches; and use MCP integration to take failure triage off people's hands. The approach still requires someone to maintain the context layer and advance the work incrementally. This is a maintained working environment, not an install-and-go solution.

Sheet 06 · Closing · build, then prune

Cut as you build: the harness's half-life

A harness has a half-life: its components encode assumptions about model capability, and those assumptions can expire. How much scaffolding can be removed depends on the capability of the selected model.

In the historical Sonnet 4.5 example, the model ended tasks early near the context limit, a behavior described as "context anxiety". A context-reset workaround addressed it. When Opus 4.5 shipped and the behavior disappeared, the workaround was no longer needed. Similarly, a hook that intercepted writes to require Perforce p4 edit became redundant once that behavior was supported natively. The maintenance focus shifts from "how to make Claude stronger" to "what can I stop doing."

Sonnet 4.5
43%
Opus 4.5
68%
Opus 4.6
84%
Compaction quality ceiling: capability, not the compression algorithm, sets the limit. The stronger the model, the more control you hand back, the thinner the harness.
Same "build a full app" task — a model upgrade lets you cut scaffolding
Opus 4.5 Planner Generator Evaluator Sprint split context reset 6h · $200
Opus 4.6 Planner Generator Evaluator Sprint split context reset 3h50 · $124

Other responsibilities remain. In the app-building comparison, the Planner and Evaluator still served separate purposes: without a Planner, the Generator under-scoped the work; without an Evaluator, edge-case bugs slipped through. The distinction is between removable scaffolding and continuing responsibilities for context discipline and independent verification.

Audit the harness every 3 to 6 months, starting with /doctor to rightsize Skills and CLAUDE.md. Anthropic removed over 80% of Claude Code's system prompt with no measurable loss on its coding evals, illustrating the scale of reduction worth testing.

134 days / 126 rel.
Claude Code's own cadence (6 Jan to 19 May 2026), ~6.6 releases a week, shipping on ~70% of days
287 days / 263 rel.
Extended to 19 Oct 2026 (2.0.77 to 2.1.304), no slowdown; the default model and default effort both changed in that window
$200→$124
Same output, cheaper and simpler after the upgrade
it just moves
The interesting harness space doesn't shrink as models improve; it relocates