$ cat index.mdx$ cat ~/blogs/engineering/inside-claude-code-binary/index.mdx # I put my name on this
Inside Claude Code: What Its Binary Says About Itself
Tell a Claude Code subagent to save its results to FINDINGS.md and the Write tool refuses.
That rule is not on the subagents docs page. It is written in plain text inside the claude binary, along with every threshold, fallback and error message the app uses.
I read the strings in Claude Code 2.1.299 for macOS and logged 256 findings, each labelled observed (the string is in the bundle) or inferred (my reasoning about why). I audited them twice and turned them into a game: Context Window, the Claude Code internals arcade. Then I rechecked seven headline findings against 2.1.330 on Linux, 31 versions later. All seven still hold.
What the claude binary is
The native claude install is one executable compiled by Bun, not a folder of JavaScript.
The app is a minified JavaScript bundle stored inside it (172,082,289 bytes in the __bun section on macOS), run on an embedded JavaScriptCore engine.
There is no node_modules and no separate Node install.
So every error message, setting name, environment variable and threshold the app uses sits in that bundle as a string you can read without a disassembler. On Linux the 2.1.330 binary is a 381 MB ELF file:
$ file ~/.local/share/claude/versions/2.1.330
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked ...
$ claude --version
2.1.330 (Claude Code)Search for strings, not function names
Minification renames functions to one to three characters and reuses those names across chunks.
In 2.1.299, function Qy(e) is defined four times at four byte offsets. One is the hook-blocking check; the others are a quoting helper, a whitespace helper and a markup helper.
A short name proves nothing. A string literal at a byte offset does.
So the whole teardown ran on fixed-string search:
# byte offset of every hit, matched literally (no regex surprises from $ ( ) [ ] .)
grep -abo -F 'dontAsk' payload.js | head
# count occurrences, not lines: minified lines hold many hits each
grep -ao -F 'resources/list' payload.js | wc -lThree traps are recorded in the findings:
- Lines undercount.
resources/listsits on 14 lines but occurs 48 times. Count with-o. - Substrings overcount.
useInputhas 71 substring hits, all inside longer names likerefuseInput. A word-boundary search finds zero. - Some names are built at runtime. The keychain entry
Claude Code-credentialsnever appears whole; it is a template plus"-credentials".
Two audits
The first audit took 327 literals from the teardown notes, searched for each in the bundle, and re-read the surrounding bytes for 43 of them.
It re-checked 314 claims and found 6 that contradicted the binary.
The second audit covered the later sections. One thing it surfaced: the draft counted 3,012 unique tengu_* telemetry event names and the audit's sweep found 3,024, most likely a difference in what each count included.
Some claims stayed out on purpose. Claude Code falls back to another model after three HTTP 529 (overloaded) responses, but the code that resets that counter was never found, so the game does not say "three in a row".
Seven findings worth changing your setup for
DISABLE_TELEMETRY=0 disables telemetry
The check is a truthiness test on the raw string, so 0 and false both count as set.
DO_NOT_TRACK is parsed properly, so DO_NOT_TRACK=0 does not opt you out.
This is the function in 2.1.330, minified names as shipped:
function g6n(){
if(process.env.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC)return"essential-traffic";
if(process.env.DISABLE_TELEMETRY)return"no-telemetry";
if(He(process.env.DO_NOT_TRACK))return"no-telemetry";
return"default"
}The non-essential-traffic switch is checked first and wins over both.
The environment variables page does warn about this, in bold: "Setting it to 0 or false still opts out." The code shows why: it is a bare truthiness test, not a boolean parse.
What to do: to keep telemetry on, unset the variable. Writing =0 does the opposite of what it reads like, and several "hidden settings" guides still get this wrong. I later checked 220 viral Claude Code hidden settings against the 2.1.330 binary, and 118 of them are not in it at all.
Subagents cannot write report files
A subagent that calls Write on a file named REPORT*, SUMMARY*, FINDINGS* or ANALYSIS* ending in .md gets this back:
Subagents should return findings as text, not write report files.
Include this content in your final response instead.The message is word for word the same in 2.1.330.
What to do: ask subagents for findings in their final answer, or give the file a name outside that pattern.
The "near your limit" notice is decided on your machine
The server sends a utilization fraction in the anthropic-ratelimit-unified-* response headers.
The client compares it with a threshold compiled into the binary: 0.95 by default, 0.99 for Max 5x, 0.9975 for Max 20x.
That notice is a client-side hint, not the limit itself.
The binary holds no usage caps; the server alone decides when a request is rejected.
dontAsk means deny
The six permission modes are default, acceptEdits, plan, auto, bypassPermissions and dontAsk.
When no rule, hook or check has an opinion about a tool call, the fallback is allow for bypassPermissions, deny for dontAsk, and ask for the rest.
The name suggests a quieter bypass. It is the opposite: anything you did not approve in advance is refused.
2.1.330 keeps all six and adds a manual alias for default, which matches headless -p runs starting in Manual mode from 2.1.302.
Hooks block only on exit code 2
Exit 2 blocks the action and feeds the hook's stderr back as the reason. Every other non-zero exit is treated as a non-blocking error, so a guard script that crashes, or never runs because it lost its execute bit, lets the action through.
What to do: set the hook command to bash guard.sh || exit 2. Calling it through bash means a missing execute bit cannot switch it off, and || exit 2 turns a crash into a block.
The orchestrator gate that verifies worker claims depends on this, and it is the same fail-open trap behind fail-closed guardrails for AI agents.
Autocompact starts 33,000 tokens early
The effective window is the context window minus min(max output tokens, 20,000), reserved for the reply.
Compaction triggers 13,000 tokens below that.
On a 200,000-token window with a large output limit, compaction starts at 167,000.
A breaker named rapid_refill_breaker stops it looping when the context refills right after each summary.
What to do: plan long sessions around 167k, not 200k.
Settings stack in five layers
The schema states the order outright: user < project < local < flag < policy.
Managed policy sits on top, so an organization's rules beat anything in your home directory or on the command line.
Smaller surprises
/costis an alias of/usage./doctoris a bundled skill dressed as a built-in command.- The
sonnetalias points at Sonnet 5.5 on Anthropic's API but Sonnet 4.5 on Bedrock and Vertex. Same alias, different model. - Feature flags come from GrowthBook and CLI errors go to Datadog. There is no Sentry SDK in the bundle; Sentry hostnames appear only in network allowlists and look like they belong to the desktop app.
What survived 31 versions
I ran the same fixed-string search over the 2.1.330 binary.
| Finding (2.1.299) | Literal searched | In 2.1.330 |
|---|---|---|
| Subagent report-file ban | Subagents should return findings as text | Held, same regex and message |
| Limit notice thresholds | 0.9975, default_claude_max_20x | Held, same function |
DISABLE_TELEMETRY any value | env.DISABLE_TELEMETRY | Held, truthiness check |
| Six permission modes | "dontAsk" mode list | Held, plus a manual alias |
| New hook events | PostToolBatch, PermissionDenied | Present (68 and 56 hits) |
| Subagent depth cap | CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH | Present, with a refusal message |
| Rate-limit headers | anthropic-ratelimit-unified | Present (121 hits) |
Counts drifted: hook events, deferred tools and command-line options all grew. All seven checks passed. That is seven of 256, so treat every card in the game as pinned to 2.1.299.
The game
Each finding is a card in the arcade: pick the right answer, sort claims into buckets, or put steps in order. Every card shows its source section and its observed or inferred label, so you can tell evidence from reasoning. The eighth sector, "Real or Hallucinated?", mixes real names from the binary with confident inventions and a few audit corrections. Its tagline: "Plausible names are cheap. Grep hits are not."
What I did not do
I read strings in a binary installed on my own machine. I did not decompile it, rebuild source code, intercept traffic or bypass any limit, and nothing here helps you do that. Minified function names appear only where the name is the evidence.
Check your own version
Pick one behavior you rely on, find the string that would have to exist for it, and count it:
B=$(readlink -f "$(command -v claude)")
strings -n 6 "$B" > /tmp/claude-strings.txt
grep -ao -F 'Subagents should return findings as text' /tmp/claude-strings.txt | wc -lA zero means the behavior changed, and you found out before your workflow did. Then play the arcade and see how many of the 256 you would have guessed.