Claude Code is Claude in a loop with tools, and everything it adds around that loop is one of two kinds: context, text the model reads and may ignore (CLAUDE.md files, skills, a hook's printed hint, a subagent's prompt), or enforcement, code the harness runs on every tool call whatever the model decides (hooks that exit 2, deny, ask and allow rules, the permission mode, the sandbox). Knowing which kind a feature is tells you whether it can be relied on.
Fig. 1, one turn of the loop in Claude Code 2.1.290 (numbers in brackets are the sections that take each part apart; not to scale)
claude -p prints a result record and exits (11).You need: what a harness is and the loop written from zero (Topic: agentic-harnesses, its Reading tab and Loop lab), and tool calling at the protocol level (Building a harness: the loop, tool calling, edit formats, stop conditions). This page assumes both and asks one narrower question per mechanism: what exactly does Claude Code do here, and what do the documentation and a real recording say?
Tool or Tool(specifier) in an allow, ask or deny list.claude -p: one task, JSON records out, exit.| Mechanism | Kind | The recorded finding on this page |
|---|---|---|
| Tools | 46 built-in tools; JSON in, text out | Read refused a 322 KB file outright, and returned only 1,821 of 3,001 lines of a 104 KB file without telling the model; Bash output over about 30,000 characters came back as a file path and a 2 KB preview MEASURED |
| Permissions | enforcement | Of 12 scripted actions, Manual mode ran 2, acceptEdits 7; allow rules in an untrusted project's settings file were ignored in -p while its deny rules held MEASURED |
| Hooks | enforcement (exit 2) or context (stdout) | A Stop hook that ran the tests turned a half-fixed run into a fixed one; a PreToolUse hook refused rm twice, the second time after Haiku tried to get past it MEASURED |
| Memory files | context | Four files loaded at start, two more only after a file in their folder was read, two never (CLAUDE.local.md and AGENTS.md, as documented) MEASURED |
| Skills | context, on demand | One project skill added 29 tokens at startup; its body arrived only when the Skill tool ran MEASURED |
| Subagents | a second loop | A custom test-runner subagent ran in the background; its calls appear only in the per-model totals MEASURED |
| Plan mode | enforcement (no edits) | Asked for Haiku, every call was answered by Sonnet 5.5: documented since 2.0.17 MEASURED |
| Headless runs | claude -p | Limits end a run with their own result subtype; a resumed session recalled a code word from the first MEASURED |
textstats, two planted bugs; open any run in the Recordings tab). MEASURED means a recording on this page (or on the parent's trace lab, named) shows it. DOCS means the Claude Code documentation for 2.1.290, read on 6 October 2026, says it, with a link. UNCONFIRMED means neither, and the claim is kept only to say so. Costs are the CLI's total_cost_usd, an API-price equivalent; the runs were paid by a Claude subscription. Version-dated changes since then are collected in one table, Dated changes.The loop is the parent page's: call the model, run the tools it asks for, append the results, repeat until a reply asks for none; Anthropic calls the phases "gather context, take action, and verify results", which "blend together" (How Claude Code works) DOCS. Five behaviours only show in a recording.
A reply can hold several tool calls, but the harness decides whether they run together. Predict before you toggle the figure: three python3 -c scripts that each sleep 2 s, and three plain sleep 2 commands, each trio asked for in one reply. Do both take about 2 s?
The scripts ran one after another: A from 930.00 to 932.01 seconds, B from 932.11 to 934.12, C from 934.19 to 936.19 (clock seconds modulo 1,000, printed by each command) MEASURED. The three sleep 2 calls all returned within 0.04 s of each other, 3.0 s after the reply finished streaming: they ran together MEASURED. The harness can tell sleep has no side effects and a python3 -c script might, so the old rule "read-only tools in parallel, mutating tools serially" holds for Bash; the docs state only that PostToolUse hooks "fire concurrently when Claude makes parallel tool calls" and a PostToolBatch hook runs once the batch has resolved (hooks reference) DOCS.
Execution does not wait for the whole reply. In the second half of that run, ls returned its result (at 9.82 s) before the model had finished streaming the next call, cat README.md (9.88 s): a call can start as soon as its block of the reply is complete. The sibling Building a harness (section 4) saw the same with edits on Sonnet 5.5: the first of two Edits ran 0.78 s before the second had finished streaming.
A turn is not a model call. With --max-turns 2 the run made two model calls, stopped before the third, and reported num_turns: 3 with subtype error_max_turns MEASURED (section 11; the parent's Trace and context lab shows the same mismatch). When you budget an agent by turns, test what your version counts.
Messages can join a running turn. In the terminal a message typed while Claude works is queued and read before its next step; Esc stops the running tool; ctrl+enter interrupts and sends the queue DOCS. Headless, through --input-format stream-json, two messages written to stdin at once produced a single result record: the reply after the first tool call answered the first question and went on to the second MEASURED (run stream). What a hard interrupt leaves behind (a rejected tool_result with is_error, then a result with subtype error_during_execution) is recorded through the Agent SDK on Building a harness, section 4.
Errors stay in the loop. Every failure in the recordings came back as an ordinary tool result marked is_error: a refused permission, a missing file, a non-unique edit string, a timed-out command (exit 143). The model decides what to do next; the harness never retries on its own.
A tool is a name, a description and a JSON schema the harness sends with every request; the model replies with a call, the harness checks permission, runs it and sends back text, which costs input tokens on every later call. Two questions decide how a tool behaves in practice: what exactly comes back, and what happens when the honest answer would be huge.
The tools reference lists 46 built-in tools for this version, far more than the "small, sharp toolset" of the old page (tools reference) DOCS. A session gets a subset, and three defaults surprise people:
find and grep through Bash; in Claude's shell those run embedded copies of bfs and ugrep, so searches reach your hooks and permission rules as Bash calls. Naming Glob or Grep in --tools or --allowedTools brings them back DOCS. The parent's recording with --tools default on a Mac listed 29 tools and neither of the two MEASURED.Task(...) kept as an alias in rules (subagents) DOCS. The init record of a headless run still lists it as Task while the model's calls say Agent MEASURED.Code can be the tool-calling interface. In Code Mode (experimental and opt-in; version in Dated changes) Claude writes a JavaScript program that calls its tools, run through one tool named REPL: one step can run commands in parallel, feed one result into the next call and return only the part Claude needs, so intermediate results never enter the context. Enforcement does not move: each call inside the program still passes the deny and ask rules and the PreToolUse hooks (sections 3 and 4). In auto mode the classifier reviews the program once rather than each call, and cannot see values the program computes while it runs (changelog) DOCS.
| Tool | What it does (docs, shortened) | Asks in Manual mode |
|---|
"Asks in Manual mode" is the docs' Permission required column: whether the tool prompts in Manual mode for paths inside the working directory. Bash is marked yes but runs a built-in set of read-only commands without asking.
One recording gave Haiku a script of eighteen tool calls, one per message, each probing one rule, with "do not retry, just move on" (run tools). Before step 2, predict: a 3,001-line file of 104 KB, under the 256 KB cap; does Read return all of it, and if not, does it say so? The figure shows each stretch's calls with the result the model got; the bar under them is the size of the next request, to scale.
cd carries over to later Bash calls inside the project (pwd prints /work/textstats); export runs, but each call is a new process; and echo "PROBE=$PROBE" is refused by the permission layer although echo is allowed, because the harness cannot check what the variable expands to.sleep 5 is killed with exit 143.file:line:text, relative to the search path. Glob returns file names matching a pattern, capped at 100, newest first.tool_use_result metadata in the stream (line counts, truncation flags, structured patches) never reaches the model. When you build your own, decide which of those facts belong in the text.| Behaviour | Documentation | Recording |
|---|---|---|
| Read, whole file over the size cap | Not stated as a byte limit; a whole-file read over the token limit returns a first page with a "PARTIAL view" notice | A 322.3 KB file: error "exceeds maximum allowed size (256KB). Use offset and limit parameters ..." MEASURED |
| Read, under the byte cap but long | "PARTIAL view" notice telling Claude how much it got | A 3,001-line, 104 KB file: lines 1 to 1,821 returned (70,625 characters, about 25,700 tokens into the cache). The harness's own record says truncatedByTokenCap: true, totalLines: 3001, but the text the model received ends at line 1,821 with no notice, and its final report did not mention the cut MEASURED |
| Read with offset and limit | Reads that range | Exactly lines 100 to 102 MEASURED |
| Edit before Read | Haiku 4.5 and older models always need the read; newer models may edit unread files that need no prompt to read | "File has not been read yet. Read it first before writing to it." MEASURED |
| Edit with a string found twice | Must appear exactly once, or replace_all | "Found 2 matches of the string to replace, but replace_all is false ..." MEASURED |
| Bash, large successful output | Inline up to roughly 30,000 characters; past that a saved file's path plus a preview of up to 2,000 characters | 40,000 characters printed: the result was a <persisted-output> block, "Output too large (39.1KB). Full output saved to: ..." plus a 2 KB preview, 2,183 characters in all MEASURED |
| Bash, large failing output | Inline up to roughly 10,000 characters, no file | 15,000 characters of stderr and exit 3: 10,039 characters came back, no path MEASURED |
| Bash state between calls | cd carries over inside the project; environment variables do not | cd textstats then pwd printed /work/textstats; export PROBE=1 ran, then echo "PROBE=$PROBE" was refused: "A variable in this command can't be checked before it runs" MEASURED |
| Bash timeout | Default 2 minutes, ceiling 10 minutes; the model may pass timeout | sleep 5 with a 2,000 ms timeout: "Exit code 143, Command timed out after 2s" MEASURED |
| Grep and Glob | Grep is ripgrep, default mode lists files; Glob caps at 100 files, newest first | Content mode returned file:line:text; Glob returned paths relative to the search root MEASURED |
Other documented limits, not exercised here: WebFetch caches 15 minutes, fails after 5 minutes (300 s since 2.1.268), refuses localhost, and passes the page through a second model call with your extraction prompt, so it is lossy by design; WebSearch is capped at 200 calls a session; background Bash commands in unattended sessions get 30 minutes, up to 2 hours; BASH_MAX_OUTPUT_LENGTH defaults to 30,000 with a ceiling of 150,000, and the bashOutputMaxChars setting raises the inline ceiling to 128,000 (tools reference) DOCS.
Every tool call passes a permission layer before it runs: code in the harness, not the model, that answers allow, ask (a person decides) or deny. Rules "are enforced by Claude Code, not by the model. Instructions in your prompt or CLAUDE.md shape what Claude tries to do, but they don't change what Claude Code allows" (permissions). In a headless run nobody is there to answer, so "ask" becomes a refusal ("This command requires approval") unless you give it a handler (--permission-prompt-tool, or the Agent SDK's callback) DOCS.
Mode (--permission-mode) | Runs without asking (docs) | Best for (docs) |
|---|---|---|
default, shown as Manual (manual is an alias) | Reads only | Reviewing every action yourself |
acceptEdits | Reads, file edits, and common filesystem commands (mkdir, touch, rm, rmdir, mv, cp, sed) inside the working directories | Iterating on code you are reviewing |
plan | Reads, plus classifier-approved commands when auto mode is available; never edits until a plan is approved | Exploring before changing |
auto | Everything, after a separate classifier model checks each action against your request | Long tasks with fewer prompts |
dontAsk | Reads and pre-approved tools; anything that would prompt is denied | Locked-down CI and scripts |
bypassPermissions | Everything except the few actions no mode approves | Isolated containers and VMs only |
From permission modes, read 6 Oct 2026 DOCS. The interactive terminal and claude -p start in different modes, and the defaults have moved between versions (see Dated changes), so pass the mode you want.
A rule is Tool or Tool(specifier) in an allow, ask or deny list, in a settings file or a flag. The specifier depends on the tool: a command pattern for Bash (Bash(npm run *)), a gitignore-style path for the file tools (Edit(/src/**) covers Edit, Write and NotebookEdit; Read(~/secrets/**) also covers Grep and Glob), a domain for WebFetch, a subagent type for Agent. "Rules are evaluated in order: deny, then ask, then allow. The first match in that order determines the outcome, and rule specificity doesn't change the order", so an allow rule can never carve an exception out of a deny, and a deny at any level (managed, user, project, flag) beats an allow at any other DOCS. Bash rules split compound commands on &&, ||, ;, |, & and newlines and require every part to match an allow; a deny or ask matches if any part does. Answering a prompt with "Yes, and don't ask again" saves the literal command as an allow rule in .claude/settings.local.json, so a token typed inline in that command is now in a file one commit from public (Agent security, section 8).
Pick a recorded action and a configuration; Fig. 2 sends the call through the checks in the order the harness runs them, and the steps below say what each check did with it. Change only the configuration and watch again: same input, different gate. The gate is this page's model of the documented order, checked against the 96 recorded decisions in the grid below.
The battery asked Haiku to attempt twelve actions in order, one call each, never working around a refusal (prompt src/prompts/perm.txt), and ran the same prompt in eight configurations (the auto column on Sonnet 5.5, the plan column answered by Sonnet 5.5). Before reading the grid, predict how many of the twelve run in the default mode. Click a cell for the exact message the model got.
What the grid shows MEASURED:
-p ran 2 of 12: the read and ls, both in the read-only set. The test command was refused: a headless agent in the default mode cannot check its own work unless you allow that command or choose a mode deliberately.rm inside the working directory, but refused sed -i ("sed command requires approval (contains potentially dangerous operations)") although the docs list sed as approved; the parent's trace lab met the same refusal on 2.1.289..claude/settings.json, stderr said "Ignoring 2 permissions.allow entries from .claude/settings.json: this workspace has not been trusted" and the allowed test command was refused; passed with --settings the same rules worked, and the deny rules (Edit(tests/**), Bash(rm *)) and ask rule (Bash(curl *)) applied either way. As documented: allow rules "grant capability", so they wait for the trust dialog a -p run never shows. For CI, pass rules on the command line or in managed settings.echo "PROBE=$PROBE" was refused with an allow rule for echo * in place: "A variable in this command can't be checked before it runs."python3 * does not cover the python Haiku kept typing; in auto mode on Sonnet the classifier let it through and the shell answered "command not found: python" (exit 127).default). On Sonnet 5.5 all twelve actions ran, test edit, curl and outside write included, because the prompt asked for each and the classifier checks that actions "align with your request". Whether it tells an injected instruction from yours is the sibling page's subject (Agent security), which also has Anthropic's own red-teaming of it: an agent set on getting past it succeeded in more than 55% of attacks, so it guards against mistakes, not an adversary. Two controls sit around the classifier: /auto-mode-setup teaches it your environment, and a mod (a plugin's hooks module) can answer decider: "person" so that only a human can approve a given call (both 2.1.304).Bash(rm *) stops rm -rf build/ but not /bin/rm -rf build/ or bash -c 'rm -rf build/', and a Read deny does not stop a Python script that opens the file itself (permissions) DOCS. For enforcement that does not depend on the command's text, the docs point to the OS sandbox (Seatbelt on macOS, bubblewrap on Linux, off by default, Bash only); when it is on, autoAllowBashIfSandboxed decides whether sandboxed commands skip the prompt (on: they run without prompts even in Manual mode) or follow the normal permission flow (off); its default has changed (Dated changes), so set it. Sandboxes, egress and injection are on Agent security.The stages and their order are a model built from the permissions, permission-modes and hooks pages (hook exit code 2 "stops the tool call before permission rules are evaluated"; then deny, ask, allow; the mode decides what nothing matched) plus two orderings the recordings show: a deny rule on a file path is enforced inside the file tool's own input check, before its read-before-edit check, and that check runs before the mode. The matrix below compares this model with all 96 recorded decisions (it reproduces every one the classifier did not make, by construction, since part of the order was read off these recordings).
Actions no mode auto-approves, even bypassPermissions: tools matched by an explicit ask rule, AskUserQuestion, MCP tools marked as needing a person, and rm or rmdir aimed at a critical path (the filesystem root, your home directory, the working directory). Writes to protected paths (.git, .claude, .vscode, shell rc files, .mcp.json) are never pre-approved by allow rules. Project or local settings cannot set defaultMode to auto or bypassPermissions (permission modes) DOCS.
The playground runs the same model as the stepper and the grid's score. It encodes the documented order (hooks, then deny, ask and allow rules, then the mode) and the orderings the recordings showed; it is a teaching model, not Claude Code's code. Presets load the cases that surprised the recordings.
Bash rules split the command on &&, ||, ;, | and &; an allow must match every part, a deny or ask any part; Bash(x *) matches x and x ...; Edit(path) covers Edit and Write with ** and * globs. Not modelled: protected paths, critical-path removals, wrappers such as timeout, environment-variable prefixes, the sandbox, and the auto-mode classifier (shown as "classifier decides").
A hook is a program the harness runs at a named moment, with a JSON description of the moment on its standard input. Its exit code and output can add context, change a tool's input, or stop what was about to happen. A prompt is advice and a hook is enforcement: "To block an action regardless of what Claude decides, use a PreToolUse hook" (memory) DOCS.
matcher (for tool events, a tool name, a | list or a regular expression), then handlers. Five handler types: command (a shell command, the common case), http (POST the JSON to a URL), mcp_tool, prompt (a one-turn model call that returns ok or not) and agent (an experimental subagent that can read files before deciding).{; 2 blocks, and stderr is fed back (to the model for PreToolUse, Stop and the other blocking events); any other code is a non-blocking error and the action goes ahead. A mistyped script path exits 127 and therefore silently disables a policy hook.permissionDecision allow, deny, ask or defer (defer only in -p), with a reason, an updatedInput that replaces the tool's input, and additionalContext. When hooks disagree, deny beats defer beats ask beats allow. A hook's allow never overrides a deny or ask rule: hooks can tighten permissions, not loosen them. A hook's deny holds even in bypassPermissions.-p run, a repository's .claude/settings.json hooks run without any trust prompt; the docs recommend --bare or --settings '{"disableAllHooks": true}' for repositories you do not trust (headless) DOCS.hooks_off)hooks_on)Two Haiku runs got the same prompt: fix the apostrophe bug, keep the change minimal, and delete notes_old.txt with rm (allowed by --allowedTools "Bash(rm *)"). The second run's project had four hooks: a SessionStart hook that prints the test command (its stdout becomes context), a PreToolUse guard on Bash that exits 2 on rm or sed -i, a PostToolUse logger that appends every call to a file, and a Stop hook that runs the tests and returns {"decision": "block"} while any fail (once: it checks stop_hook_active so it cannot loop). Predict which run ends with passing tests, and whether the file gets deleted in either; the figure plays both runs on one clock (hook events are purple), one stretch per step.
What the two recordings show MEASURED:
python3 tests/test_core.py on its first try. Two tests fail. Without hooks it is still reading files.rm. The first rm was blocked with the hook's stderr as the reason, whatever --allowedTools said.rm runs and the tests never do. Haiku fixed the apostrophe bug, deleted the file (it was allowed), then tried the tests as python (refused: only python3 and rm were allowed) and never ran them.decision: block: its reason ("the test suite still fails ... FAIL test_top_words_ties_alphabetical") came back as a user message.dangerouslyDisableSandbox: true, a parameter meant for retrying outside the OS sandbox. The hook does not care about that flag, so the call was blocked again, and the final summary said the file was left in place. A rule the model can argue with is not a rule.The parent page counted 32 on 5 October; the 2.1.290 reference lists 33 (both the lifecycle table and the event sections) DOCS. Seventeen can stop something: sixteen by exit code 2 or a block decision, and PermissionRequest through its decision object only.
| Event | When it fires | Matcher | Can it stop it? |
|---|
hooks block in any settings file (user, project, local, managed), a plugin's hooks/hooks.json, or the frontmatter of a skill or subagent (active while it runs). Entries merge across levels; identical handlers run once; all matching hooks run in parallel (hooks) DOCS.The hook scripts and settings are in this page's src/hooks/; the log's first line shows the input every PostToolUse hook receives: cwd, duration_ms, hook_event_name, permission_mode, prompt_id, session_id, tool_input, tool_name, tool_response, tool_use_id, transcript_path. With --include-hook-events, -p streams a hook_started and a hook_response record (with stdout, stderr and exit code) for each.
Memory files are Markdown files of instructions that Claude Code puts into the context for you: CLAUDE.md and its relatives. They are not memory in the database sense; they are text paid for on every call, delivered "as a user message after the system prompt, not as part of the system prompt itself" (memory) DOCS. The documented rules:
/Library/Application Support/ClaudeCode/CLAUDE.md on macOS, /etc/claude-code/CLAUDE.md on Linux), user (~/.claude/CLAUDE.md), project (./CLAUDE.md or ./.claude/CLAUDE.md), local (./CLAUDE.local.md, meant to be git-ignored), and rules in .claude/rules/*.md.paths: list in their frontmatter, load only when Claude reads, writes or edits a matching file.@path inside a CLAUDE.md pulls in another file at launch, relative to the importing file, at most four hops deep. Imports organise a file; they do not save context./config setting can load both.~/.claude/projects/<project>/memory/, whose index MEMORY.md loads at every start up to 200 lines or 25 KB. Subagents do not get it.To check the order rather than trust it, one recording planted eight files, each containing one unique word ("Canary: ALPHA-ROOT" and so on), then asked Haiku, with only the Read tool, to list every canary in its context, read textstats/core.py, and list them again (run memory).
@docs/style.md: the import is expanded at launch, so it costs the same as writing its text inline.--setting-sources project, and local is not in it (the docs' rule is quoted below the steps)..claude/rules/general.md (DELTA-RULE) is in; python.md, with paths: textstats/**, waits for a matching file.textstats/core.py. Reading a file under textstats/ attaches that folder's CLAUDE.md (FOXTROT-SUBDIR) and the rule whose paths match (ECHO-PATHRULE).Every outcome matched the documentation MEASURED: four files at launch (steps 1 to 4), two after the Read (step 7), and two never. CLAUDE.local.md stayed out because these runs pass --setting-sources project, and "CLAUDE.local.md is skipped if you exclude local from --setting-sources"; AGENTS.md stayed out because a CLAUDE.md existed. The parent-directory canary is the one to remember: a CLAUDE.md anywhere above your project, in a home directory or a monorepo root, is in every session started below it.
A skill is a folder with a SKILL.md: YAML frontmatter (a name and a description of when to use it) and Markdown instructions, plus any scripts or reference files it needs. Claude Code follows the Agent Skills open standard, which Anthropic gave to the Agentic AI Foundation (the Linux Foundation project that also hosts MCP) on 22 October 2026, with Anthropic counting more than 70 platforms that use it (Anthropic; spec at agentskills.io); custom slash commands in .claude/commands/ have been merged into skills (skills) DOCS. The design is progressive disclosure: only the name and description sit in context from the start; the body loads when the skill is invoked, through the Skill tool or by you typing /name, and then stays in the conversation.
disable-model-invocation: true keeps a skill out of Claude's view (you invoke it); user-invocable: false the opposite; allowed-tools pre-approves tools for the turn that invokes it; context: fork runs it in a fresh subagent; paths loads it only near matching files; !`command` in the body runs a shell command first and inlines its output.Two one-call recordings measure the startup cost, identical except for one project skill (.claude/skills/run-tests/, a two-sentence description and a body containing the canary KILO-SKILLBODY), and a third gives the running example with the skill available, in the figure MEASURED.
The skill's description cost 29 tokens at launch. In the task run Haiku listed the files, saw the skill, and called it before anything else: the Skill tool returned "Launching skill: run-tests", and the body arrived as a separate user message ("Base directory for this skill: ... Canary: KILO-SKILLBODY ..."), 329 tokens written to the cache on the next call. The skill told it to run python3 tests/test_core.py, and it did, first time; the run fixed both bugs in 9 model calls. Compare the hooks run without a SessionStart hint, which reached for python: the same fact, delivered three ways (a CLAUDE.md line, a SessionStart hook, a skill), and all three worked here because each put the right command in front of the model before it guessed.
Two limits show up at scale, in Dan Luu's 160-run conditions of GPT-5.6 Sol in Codex, which loads skills the same way. Loaded is not used: agents read the ECC testing skill in 153 of 160 runs and many then ignored it; Trail of Bits' skill was opened in only 108. A long body is paid again on every re-read: the official Hegel skill (34k characters plus a 45k-character reference) was loaded in 157 of 160 runs and re-read on many steps, adding 16% (medium effort) and 18% (xhigh) to the bill even at a 99.85% cache hit rate, and none of the four skills made runs more correct (How well do agents use test/verification techniques?). The author's conclusion: for a model that already knows the subject, a skill should be short and push it off its defaults, not teach the technique.
For when skills help and when they misfire, see Demystifying Agent Skills; the budget arithmetic of what loads when is on Context engineering.
Plugins bundle skills, subagents, hooks and MCP servers as one installable unit; their skill and agent descriptions are also in context on every turn (plugins). A plugin may also ship a JavaScript hooks module, which makes it a mod: its hooks (tool.check, agent.spawn, turn.step and others) change deeper behaviour, such as refusing a tool call or rewriting a subagent's prompt, and can add parts to the interface (changelog).
A subagent is another run of the loop that the main agent starts with the Agent tool: it gets a task message, works in its own context window, and only its final answer comes back. "The parent doesn't see the subagent's intermediate tool calls or outputs, only that final result" (tools reference) DOCS. What it starts with, per the subagents page DOCS:
The recording (run subagent) defined a test-runner subagent (tools Bash and Read, model haiku, a five-line prompt: run the tests, report failures, edit nothing) and asked for the running example, "use the test-runner subagent to run the tests, once before your fix and once after it". Fig. 4 draws each context window to scale from the run's own records MEASURED:
-p. The Agent call returned at once ("Async agent launched successfully" with an id) and a second window opened beside the parent's. Say in the delegation what the parent should do meanwhile, or ask for a foreground run.tools list is the enforcement (it had no Edit).modelUsage says $0.097, so the two subagent instances cost about $0.035, 36% of the run. That difference reproduces exactly only if the subagent's 9,884 cache-write tokens are 5-minute writes (1.25 times the input price) while the parent's were 1-hour writes (2 times): derived, since no record states the subagent's TTL. The parent's trace lab found the same with Explore: read cost from modelUsage, never from usage.Naming. The init record lists the tool as Task; the call itself is named Agent.
.claude/agents/ (or ~/.claude/agents/, a plugin, or --agents JSON) with frontmatter: name, description (when to use it), tools or disallowedTools, model, permissionMode, maxTurns, skills, hooks, memory, isolation: worktree, omitClaudeMd (2.1.271).claude, statusline-setup and claude-code-guide. Up to 20 run at once; by default a subagent may start its own, three levels deep; they run in the background by default and can be resumed with SendMessage. A fork (/subtask) is the exception that inherits the whole conversation and shares its prompt cache. Claude can also start one itself through the Agent tool's fork subagent type (CLAUDE_CODE_FORK_SUBAGENT=0 turns it off); the recording below used a defined, non-fork subagent.Agent teams are different: separate Claude Code sessions with a shared task list and messages between them, experimental and off by default (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1) (agent teams) DOCS. When several agents help or hurt is the subject of Multi-agent patterns; subagents as a context tool are on Context engineering.
Plan mode lets Claude read files and run read-only commands, write a plan, and edit nothing until a person approves it; in the terminal, Shift+Tab cycles into it. In -p runs and the Agent SDK "Plan mode keeps its blocks", and ExitPlanMode is disabled because nobody can approve (permission modes; the parent's trace lab) DOCS. In the permission battery, plan mode refused the edit and both writes with "Cannot write to ... while in plan mode", and refused the test command as needing approval MEASURED.
The same run asked for Haiku and its init record says Haiku, yet every one of its 13 calls was answered by claude-sonnet-5-5 MEASURED. The parent page recorded this on 2.1.289 and called it undocumented; it is in the changelog for 2.0.17 (15 October 2025): "Haiku 4.5 automatically uses Sonnet in plan mode, and Haiku for execution (i.e. SonnetPlan by default)" (changelog) DOCS. The lesson stands: read the model field of each call, not the flag you passed, because the harness may route around it, and with it the price (Sonnet 5.5 costs twice Haiku 4.5 per token). Newer default models change this arithmetic (see Dated changes).
Everything in sections 2 to 7 lands in one window: the system prompt and tool definitions, the memory files, the skill listing, MCP tool names, and then the conversation with every tool result. claude -p "/context" prints the window by category without calling the model (cost 0) MEASURED; the parent's Trace and context lab measures what each part costs at startup. Two design choices keep that window cheap and stable. --system-prompt-snapshot (on by default) records the system prompt on the first request and resends it verbatim until the conversation is compacted DOCS, so the cached prefix does not change under the session. And the large, rarely needed parts load on demand: skill bodies (section 6), nested memory files (section 5), MCP tool definitions (section 10).
When the window fills, auto-compaction replaces the conversation: "It clears older tool outputs first, then summarizes the conversation if needed" (how Claude Code works) DOCS. What comes back afterwards is decided by where each piece lives (Fig. 5; sizes illustrative, parts and rules documented):
/compact the project-root CLAUDE.md is re-read from disk; nested files and path rules load again on demand (memory) DOCS. The context window explorer adds that up to five of the most recently modified files are re-read (a file over 5,000 tokens comes back only as a path) DOCS./compact also runs inside a --input-format stream-json session, emitting a compact_boundary record whose preserved segment keeps the last 5 messages verbatim MEASURED; forced compactions are recorded on Context engineering: window budgets, caching, compaction, memory files, subagents, its section 4.Idle compaction: the terminal also compacts a conversation over 200K tokens left for about 54 minutes, before its one-hour prompt cache expires, so the next message does not reprocess it all ("idleCompaction": false turns it off; changelog) DOCS.
The design consequence, in the docs' words: "Put persistent rules in CLAUDE.md rather than relying on conversation history"; a "Compact Instructions" section in CLAUDE.md, or /compact with a focus, steers what the summary keeps DOCS. Why compaction, caching and subagents are the three levers of any agent's window, and their arithmetic, is owned by Context engineering.
An MCP server is a separate process or remote service whose tools Claude Code offers the model next to the built-in ones; the protocol is owned by MCP. What Claude Code adds is configuration, naming, loading and limits. Facts from the MCP docs and permissions, read 24 October 2026 (a later version than the recordings) DOCS:
| Scope | Loads in | Stored in |
|---|---|---|
Local (the default for claude mcp add) | this project, only for you | ~/.claude.json |
| Project | this project, shared through version control | .mcp.json at the project root |
| User | all your projects | ~/.claude.json |
managedMcpServers above all; "The entire server entry from that source is used; fields are not merged across scopes."managed-mcp.json file or the managedMcpServers managed setting (the setting needs Claude Code 2.1.259 or later), and restrict the rest with allowedMcpServers and deniedMcpServers..mcp.json; in claude -p and Agent SDK sessions it "can't show that prompt: it loads project-scoped servers without asking". The recordings pass --strict-mcp-config so only servers named on the command line load.${VAR} and ${VAR:-default} expand inside .mcp.json.mcp__<server>__<tool>. mcp__puppeteer or mcp__puppeteer__* matches every tool of that server; an allow glob needs the literal mcp__<server>__ prefix, while a deny of mcp__* removes every MCP tool from context.ENABLE_TOOL_SEARCH=auto loads tools upfront while their definitions total under 10% of the window; false loads all upfront; alwaysLoad exempts one server.MAX_MCP_OUTPUT_TOKENS raises it); successful text over 50,000 characters is saved to a file, the same pattern as Bash in section 2.The reverse direction also exists: claude mcp serve (in the 2.1.290 CLI help) runs Claude Code itself as an MCP server.
-p, the stream, the resultclaude -p "task" runs one task without the interactive screen and exits: 0 on success, non-zero when the run fails, 143 on SIGTERM (headless) DOCS. --output-format picks text, json (one final object) or stream-json (one JSON record per line as things happen; needs --verbose, and --include-partial-messages adds the raw API stream). The parent's Trace and context lab explains the five main record kinds (init, assistant, user, stream_event, result).
| Run | Flag | Model calls | num_turns | Result | Cost (CLI) |
|---|
--max-budget-usd 0.02 stopped the run at $0.0238, 19% over, after the call that crossed the line; that call's requested tool never ran MEASURED. The docs say the cap is checked "against its client-side cost estimate" and that subagent spend counts. Set the cap below what you can afford by one call; Building a harness recorded the same on 2.1.289 and compares both flags with hand-written stop rules (its section 10, whose rule for your own harness is "Check budgets before each model call").usage. In the budget run the result's usage covers four calls ($0.0198 at list prices) while modelUsage covers all five and reproduces total_cost_usd exactly ($0.0238) MEASURED. Same lesson as the subagent run: account from modelUsage.--session-id) was told a code word; session 2, started with --resume, read 6,753 tokens of it back from the prompt cache, wrote 627 new ones and answered "ZULU-42". Its total_cost_usd was $0.018745, which is session 1's $0.016381 plus its own $0.002364: the totals are cumulative across resumes MEASURED. Sessions are JSONL transcripts under ~/.claude/projects/; resume replays the transcript, which is why session 1's "I've saved the code word" was true only in that sense (it had no tools).-p run never shows the workspace trust dialog, so a repository's hooks, env, apiKeyHelper and .mcp.json servers are used anyway, while its permissions.allow rules are not (section 3) DOCS. The docs recommend --bare for scripts and CI: it skips discovery of hooks, skills, plugins, MCP servers, auto memory and CLAUDE.md, and "will become the default for -p in a future release". It also reads only an API key or an apiKeyHelper passed with --settings, never OAuth, so it cannot run on a subscription login; the runs on this page instead pass --setting-sources project --strict-mcp-config and a throw-away directory.The recordings here add the rest of the record kinds:
| Record | What it carries | Seen in |
|---|---|---|
system/permission_denied | Tool, decision type (rule, mode, workingDir, subcommandResults, other) and the message the model gets; the result repeats them as permission_denials | 59 times in the permission runs |
system/hook_started, hook_response | Hook name (PreToolUse:Bash), stdout, stderr, exit code, outcome; only with --include-hook-events, except SessionStart | hooks_on (19 pairs) |
system/task_started, task_progress, task_notification | A background subagent's start, its running token total and tool count, and its finish with a summary | subagent |
system/status, system/thinking_tokens | "requesting" before each call; an estimate of thinking tokens while the model thinks | every run |
system/notification | What the terminal would show, e.g. "Stop hook error occurred" | hooks_on |
rate_limit_event | The subscription's rate-limit status | every run |
result subtypes | success, error_max_turns, error_max_budget_usd seen here; the error results carry no result text | maxturns, budget |
Other headless flags worth knowing: --json-schema for validated structured output (the frameworks root measured it: a tool named StructuredOutput, Topic: agentic-frameworks); --permission-prompt-tool to route approvals to an MCP tool; --permission-prompts none (2.1.259) to deny every prompt outright; --fallback-model; --no-session-persistence; --restricted (2.1.248) for evaluation harnesses, which removes command-running tools and ignores user and project settings.
Precedence, highest first: managed settings (set by an organisation), command-line flags, .claude/settings.local.json, .claude/settings.json, ~/.claude/settings.json. Lists such as permissions.allow merge across files rather than replace; a deny anywhere beats an allow anywhere; settings edits, hooks included, are picked up live and fire a ConfigChange hook (settings) DOCS.
| Key | What it does |
|---|---|
permissions | allow, ask, deny, defaultMode, additionalDirectories, disableBypassPermissionsMode, disableAutoMode (section 3) |
hooks, disableAllHooks, allowManagedHooksOnly | Hooks (section 4); a managed setting can block every non-managed hook |
sandbox.* | The OS sandbox for Bash: enabled, filesystem allow and deny lists, allowed domains, autoAllowBashIfSandboxed (sandboxed commands skip the prompt; default changed in 2.1.325, see Dated changes); see Agent security: permissions, sandboxes, prompt injection, egress |
model, availableModels, maxEffortLevel | Default model, the models a user may pick, and a cap on reasoning effort on every provider (2.1.267) |
env | Environment variables for the session, e.g. BASH_MAX_OUTPUT_LENGTH, CLAUDE_CODE_PROMPT_CACHE_TTL |
bashOutputMaxChars | Inline Bash output ceiling, up to 128,000 characters (2.1.261) |
claudeMdExcludes, autoMemoryEnabled | Skip memory files by path; turn auto memory off |
cleanupPeriodDays | How long session transcripts and checkpoints are kept (30 days by default) |
attribution | Commit and pull-request bylines (replaces the deprecated includeCoAuthoredBy) |
managedMcpServers | Managed only: HTTP and SSE MCP servers pushed to every user (2.1.259) |
The five settings sources, highest first. The example shows one model value and the permissions lists from three of them; illustrative values, documented rules.
The Claude Agent SDK (Python claude-agent-sdk, TypeScript @anthropic-ai/claude-agent-sdk; renamed from the Claude Code SDK on 29 September 2025) runs this same loop, tools, permission system, hooks and MCP support as a library: your code supplies the prompt, the options and callbacks instead of a terminal. It drives a bundled copy of the CLI (0.2.163 bundled Claude Code 2.1.286 on 5 October), so this page applies, with three differences that bite: hooks and permission prompts become Python or TypeScript callbacks, and unless you pass strict_mcp_config=True with explicit setting sources, a subscription login loads your connected apps as tools (measured by the frameworks root) MEASURED. And the SDK's system_prompt=None means an empty system prompt, not Claude Code's (the Python SDK passes --system-prompt ""), so the Claude Code preset must be asked for explicitly (Claude Agent SDK, its section 3). The library, its options and its deployment patterns are owned by Claude Agent SDK: the Claude Code loop as a library; when to use it instead of a framework is on Topic: agentic-frameworks.
Version facts change monthly; they are gathered here instead of in the mechanisms above. Each row is from the changelog unless named, read 6 October 2026 and updated through 16 November 2026. Search the changelog before trusting any version number, including these.
| Version, date | Change that matters for this page |
|---|---|
| 24 Feb 2025 | Introduced as a limited research preview with Claude 3.7 Sonnet (Anthropic); a terminal app, IDE extensions, a desktop and web app and a GitHub integration now share the same core |
| 1.0.0, 22 May 2025 | Generally available |
| 1.0.77 | opusplan: Opus while planning, Sonnet otherwise |
| 2.0.17, 15 Oct 2025 | "Haiku 4.5 automatically uses Sonnet in plan mode, and Haiku for execution (i.e. SonnetPlan by default)" (section 8) |
| 2.0.24, 20 Oct 2025 | Sandbox mode for the Bash tool on Linux and Mac |
| 2.1.32, 5 Feb 2026 | Agent teams, research preview, off by default |
| 2.1.63 | Task tool renamed Agent (subagents page; not in the changelog) |
| 2.1.268, 10 Sep 2026 | TaskCreate and friends offered by default only on older models; WebFetch times out at 300 s |
| 2.1.275, 17 Sep 2026 | ctrl+enter interrupts and sends queued messages (send-now) |
| 2.1.277, 18 Sep 2026 | AGENTS.md read when no CLAUDE.md exists |
| 2.1.283 | The interactive terminal starts in auto mode |
| 2.1.284 | Sonnet 5.5 becomes the default Sonnet |
| 2.1.287, 1 Oct 2026 | Plugins may ship a JavaScript hooks module (mods) |
| 2.1.290, 5 Oct 2026 | The version recorded on this page; --system-prompt-snapshot new and on by default |
| 2.1.292, 2.1.295, 2.1.299 | The MCP client negotiates the MCP 2026-07-28 protocol version by default: local stdio servers, then claude.ai connectors, then cloud and Remote Control connectors (MCP_PROTOCOL_NEGOTIATION=legacy opts out) |
| 2.1.293, 7 Oct 2026 | The default Haiku on the Anthropic API is Claude Haiku 5.5 (claude-haiku-5-5, $0.10 and $0.50 per million input and output tokens), so plan-mode routing to Sonnet 5.5 would now cost twenty times the execution model's price per token; whether Haiku 5.5 also plans on Sonnet was not recorded here (unconfirmed) |
| 2.1.299 | Idle compaction in the terminal (section 9) |
| 2.1.302, 16 Oct 2026 | -p and Agent SDK sessions with no permission mode start in Manual (default) on third-party providers with telemetry off or on a fresh install; the fork subagent type is on in claude -p, the Agent SDK, the desktop app and VS Code |
| 2.1.304, 19 Oct 2026 | /auto-mode-setup reads the project and recent sessions to teach auto mode about the environment; a mod's tool.check can answer decider: "person", so only the permission dialog or a host callback can approve that ask (no classifier) |
| 2.1.305 to 2.1.310, 20 to 23 Oct 2026 | The claude_code.safety_event OpenTelemetry event for each tool call a permission rule, auto mode, a safety check, a hook or the sandbox stopped, prompted or sent back (2.1.307); /claude-api api-version moves Claude API code to API version 2026-10-21 (2.1.307); sed -i gets the ordinary Bash prompt instead of a simulated edit preview and is no longer undone by /rewind (2.1.309); sandbox.allowNestedUserNamespaces lets sandboxed Linux commands create user namespaces, which the changelog says gets around the sandbox's file protections (2.1.305) |
| 2.1.317 to 2.1.325, 2 to 13 Nov 2026 | A check that asks before a web or shell tool call sends your account email address to the network (2.1.317; 2.1.325 extends it to scripts a command runs, file writes, web fetches and MCP calls); MCP tasks run in the background in the terminal, and permissions.denyInsteadOfPrompting denies a call that would wait on a prompt so the turn continues (2.1.319); Code Mode, experimental, opt-in with CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1, terminal only, not in -p, the Agent SDK or the IDE and desktop apps, and only on Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.2; project settings cannot turn it on (2.1.323); sandboxed Bash commands follow the normal permission flow by default (sandbox.autoAllowBashIfSandboxed: true restores the old behaviour), and a fix for a Bash allow rule that could run a different program than the one it names (2.1.325) |
This page replaces "Claude Code: deep dive" (last edited 22 September 2026). Its deployment list is checked in the next block; the rest is here. holds means a source or a recording on this page confirms it; corrected means it was partly wrong or is out of date; unconfirmed means no primary source was found.
| Old claim | Verdict | Where it stands now |
|---|---|---|
| Launched February 2025; CLI, VS Code and JetBrains extensions, web UI with cloud sessions, GitHub app | holds | Research preview 24 Feb 2025, generally available in 1.0.0 on 22 May 2025 (dated table) |
| A single-threaded master loop, "internally codenamed nO in early decompiled analyses"; "~98% of the code is infrastructure" | unconfirmed | The loop is documented and recorded (section 1); the codename and the 98% come from third-party decompilation and are not repeated as fact |
| Read-only tools in parallel, mutating tools serially | holds | For Bash: three sleep calls overlapped, three python3 scripts ran one after another (section 1); the rule itself is not stated in the docs |
| One main thread, Anthropic rejected multi-agent swarms for the primary flow | unconfirmed | No primary statement found; subagents run in the background by default and agent teams exist as an experiment (section 7) |
| Real-time steering: queued messages, Esc to interrupt | holds | Documented; a second message on stdin joined the running turn (section 1) |
| TodoWrite keeps the model honest; Plan Mode (Shift+Tab) is read-only | corrected | TodoWrite is off by default, replaced by TaskCreate and friends, which newer models do not get by default (section 2); plan mode holds, and runs Sonnet when you ask for Haiku (section 8) |
| Auto-compaction summarises as the window fills | holds | "It clears older tool outputs first, then summarizes the conversation if needed"; what survives is in section 9 |
| "The scratchpad directory and CLAUDE.md act as external memory" | corrected | CLAUDE.md, rules and auto memory are the documented mechanisms (section 5); no "scratchpad directory" in the memory docs |
| Small toolset: Read, Write, Edit, Bash, Grep, Glob, WebFetch, WebSearch, Task, NotebookEdit | corrected | 46 built-in tools; Task was renamed Agent in 2.1.63; Glob and Grep are absent by default on macOS and Linux (section 2) |
| Tool descriptions are long and prescriptive | unconfirmed | The stream never shows them; only their size: adding Edit, Write, Bash, Grep and Glob to Read cost 5,233 tokens on Haiku 4.5 (parent's trace lab: 13,219 against 7,986) |
| CLAUDE.md levels; AGENTS.md "a full alternative since 2.1.278" | corrected | Levels hold; AGENTS.md arrived in 2.1.277 and is read only when no CLAUDE.md exists, unless you change a setting (section 5) |
Slash commands are prompt templates in .claude/commands/ | corrected | Merged into skills: the same file still works and behaves as a skill (section 6) |
| Hooks on lifecycle events that can block or inject context | holds | 33 events in 2.1.290, 17 can stop something; recorded blocking and logging (section 4) |
Subagents launched via the Task tool, defined in .claude/agents/*.md | corrected | The tool is Agent (Task remains an alias and still names it in the init record); definitions hold (section 7) |
| Agent teams, research preview, "v2.1.220+, Aug 2026" | corrected | Research preview since 2.1.32, 5 Feb 2026, still experimental and off by default |
MCP client, and server via claude mcp serve | holds | claude mcp serve is in the 2.1.290 CLI help; configuration in section 10; protocol versions in the dated table; the protocol itself is on MCP |
| Plugins bundle skills, commands, hooks, agents and MCP configs; output styles and status line | holds | Plugins docs; output styles change the system prompt and do not reach non-fork subagents. A plugin with a JavaScript hooks module is a mod (section 6) |
claude -p with JSON output for CI; the Agent SDK is the same loop as a library | holds | Sections 9 and 11 |
| "Claude Fable 5.1 became the default model in 2.1.257, which also tightened sandbox safeguards" | corrected | 2.1.257 made Fable 5.1 the default Fable model; no sandbox tightening in that entry (the nearest is an auto-mode "Containment Escape" rule). Opus 5.5 became the default Opus model and the Pro default moved to Opus in 2.1.280; Sonnet 5.5 the default Sonnet in 2.1.284 |
| Sandboxed bash "v2.0.5+" | corrected | The changelog's first sandbox entry is 2.0.24, 20 Oct 2025: "Releasing a sandbox mode for the BashTool on Linux & Mac" |
Default-ask with allowlists; --dangerously-skip-permissions only inside containers | holds | Manual is the -p default; bypass is "isolated containers and VMs only" (section 3). The interactive default is now auto (2.1.283) |
"Use # to append memories" | unconfirmed | Not in the 2.1.290 memory docs, which name asking Claude ("add this to CLAUDE.md") or /memory |
/rewind rolls back code and conversation | holds | Six options (code and conversation, either, two summarise options, cancel); edits made through Bash and most subagent edits are not restored; 100 checkpoints kept (checkpointing) |
Practices: curate CLAUDE.md, plan first, subagents for fan-out, /compact at checkpoints, worktrees, a Stop hook that runs tests, vendored skill packs | holds | Reasoning, kept; the Stop-hook practice is recorded in section 4 |
The old page grouped the releases 2.1.257 to 2.1.278 (September 2026) by what each changed for a deployer. Each claim was checked against the changelog (every entry is dated; read 6 October 2026), together with the old page's other version and date claims: 22 of 32 hold, 8 needed a correction, and 2 are not in the changelog at all:
| Old page's claim | Verdict | What the changelog says |
|---|
--bare (no repo hooks, skills, MCP or CLAUDE.md) or at least --settings '{"disableAllHooks": true}' and --strict-mcp-config; an explicit --permission-mode (dontAsk) with exact allow rules on the command line; a container or the OS sandbox with no secrets and egress limited; --max-turns and --max-budget-usd (knowing the budget overshoots by one call); read the result's subtype and modelUsage.Sources are linked where each fact is used; documentation pages are those of Claude Code 2.1.290, read on 6 October 2026. Recordings: 23 runs of Claude Code 2.1.290 on 6 October 2026 (Claude Haiku 4.5 unless stated; plan mode answered by Sonnet 5.5; one auto-mode run on Sonnet 5.5), on a Claude subscription; costs are API-price equivalents at that day's list prices. Redacted copies, prompts, hook scripts and the scripts that built every number are in this page's src/; the old page's text is in src/live.md, its fate claim by claim in src/coverage.json, and this rebuild's knowledge ledger in src/ledger.json.
All 23 runs recorded for this page on 6 October 2026: Claude Code 2.1.290, claude -p with --output-format stream-json --verbose --include-partial-messages --setting-sources project --strict-mcp-config, each in a fresh copy of the task repository (textstats, two planted bugs), with the flags each card lists. Pick one to read it call by call. Times are seconds since the run started, as the records arrived.
Redacted: the task directory is /work, its parent /run, other temporary paths "/tmp/(redacted path)"; the home directory is /home/user; session ids, request ids and thinking signatures are removed; message and tool ids are short labels. Claude Code's own tool messages contain em-dashes; each was replaced by a comma (27 in all). Long texts are cut here; the full redacted records are in src/recordings/.
Every link checked on 6 October 2026. Times are estimates for a careful read.
All 23 runs, call by call, with prompts, flags, test results and diffs. About 20 min.
What a harness is, compared across products; this page is its child. Tabs: Loop lab (a harness built from zero in seven recorded steps), Trace and context lab (22 Claude Code runs: startup context, caching, spread, a budget model), Harness atlas (23 harnesses on dated axes). Reading 21 min, plus 3 in closed details.
The loop one layer down: templates, tokens, parallel calls, streaming, edit formats measured, stop rules. Tab: Edit format bench; the stop rules are inline in section 10. Reading 35 min, plus 19 in closed details.
Owns prompt caching, compaction (forced ones, recorded) and the budget arithmetic of memory files and skills. Its former labs now sit beside the claims they prove: cache placement in section 2, real compactions in section 4, the needle grid in section 9. Reading 35 min, plus 25 in closed details.
Owns the OS sandboxes (Seatbelt, bubblewrap), egress, credentials and the defences against prompt injection. The trifecta design tool is in section 1, every gate decision in section 4. Reading 28 min, plus 3 in closed details.
The other coding harnesses read from source at pinned commits and run on one task. Tab: Same task, every harness; Aider's repository map is in section 5. Reading 26 min, plus 22 in closed details.
Resident, message-driven agents and their trust boundary. Tab: A day, replayed; the gate designer is in section 6. Reading 32 min, plus 29 in closed details.
Scaffold sensitivity, RL environments, trajectories as training data. Tabs: Scaffold experiment, Environment lab; rollouts to a dataset and self-improving harnesses are Reading sections 6 and 7. Reading 33 min, plus 16 in closed details.
This harness as Python and TypeScript, with callbacks for hooks and permissions. About 29 min.
When a framework, when a harness; structured output through --json-schema measured. About 28 min, plus 3 in closed details.
When several agents help or hurt; subagents and teams in context. Reading 32 min, plus 14 in closed details.
The protocol behind Claude Code's external tools, on the wire. About 37 min.
Namespaces, seccomp and sandboxes at the OS level. About 51 min.
When skills help and when they misfire. 25 min, plus 4 in closed details.
Article page: four testing skills measured over 160 runs each; loaded is not used, and a tutorial-length skill costs up to 41% more for nothing (section 6). 23 min, plus 5 in closed details.
How to grade runs like the ones on this page. About 30 min.
The reference this page checks against; read Tools reference, Permissions, Permission modes, Hooks, Memory, Skills, Subagents and Headless first. About 2 h for those eight.
Dated entries for every version; search it before trusting any version number, including this page's. 15 min a month.
Anthropic's playbook for working with it day to day. About 30 min.
Worked examples: protecting files, logging commands, formatting after edits, re-injecting context after compaction. About 25 min.
Anthropic, 29 Sep 2025: the reasoning behind compaction, notes and subagents. About 25 min.
Anthropic, 11 Sep 2025: tool design, including the 25,000-token response cap. About 25 min.
The same harness as a library. About 35 min for the core pages.
A third-party reverse-engineering of an early version; read as history, not as documentation (its codename and code-share figures are unconfirmed). About 20 min.
Anthropic's public skill collection: real SKILL.md files to copy from. Browse, 15 min.