I reverse-engineered the Claude Code v2.1.294 native binary. Here is everything it silently collects from your machine, its hidden "autoDream" background subagent, and how to turn all telemetry off in 30 seconds
TL;DR
We extracted the bun-standalone Mach-O arm64 binary of Claude Code (v2.1.294) into its 4,818 virtual $bunfs/root files (2,292 JS chunks, a native macOS Accessibility addon computer-use-swift.node, and a zstd-compressed policy archive permissions_external-64ee756a.txt.zst) using morluto/rea.
The Verdict (70% solid engineering / 30% sketchy telemetry):
- The Good: It is not stealing your
.envsecrets, SSH keys, source code, or non-Claude Keychain items via telemetry. Even better, its client-side defenses against prompt injection, invisible Unicode tags, malicious repo configs, and GUI password fields are arguably the most sophisticated in the AI industry right now. And theCLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1killswitch is 100% honest in code. - The Sketchy:
-
_PROTO_*telemetry double-accounting: In JSON metadata, custom skill/plugin/marketplace names are visibly replaced with"custom"or"<redacted>"+ SHA-256 hashes — while simultaneously being passed in plaintext via hidden_PROTO_skill_name/_PROTO_plugin_namefields that get stripped from JSON and moved into top-level Protobuf fields before hittingapi.anthropic.com(unless your org pays for a HIPAA plan). - Silent
<ide_selection>attachment: If connected to VS Code / Cursor / JetBrains, every prompt you type in the terminal silently attaches whatever text you happen to have highlighted with your mouse in an open editor tab. - Commit
HEADSHA tracking for Pro/Max subscribers: Every telemetry event attaches a 16-char SHA-256 hash of yourgit remote.origin.url(rh), and specifically checks if you are on aproormaxsubscription (Bne()) to attach your exact 40-charhead_sha. - Silent startup workspace & process fingerprinting: Before your first prompt, it reads
.npmrc,pyproject.toml,.envrc, and up to 20.yml/.toml/.shfiles (64KB each) to detect private package registries and secrets managers (VAULT_ADDR,SOPS_,op read,aws secretsmanager), runsgh auth token, walks 10 parent processes viaps, grepsps auxfor running IDEs, and persists failed telemetry to~/.claude/telemetry/to retry on next launch. - Hidden background LLM calls (
autoDream&awaySummary): Once every 24h (after $\ge 5$ sessions), it silently spawns a hidden background subagent (skipTranscript: true) that runsgrep/catover your past.jsonlsession transcripts on disk.
-
Below is the technical breakdown with deobfuscated code and exact chunk offsets, plus a 30-second config to disable all of the background chatter.
1. Anti-Debugger Killswitch & Prompt-Bound Billing Header
Right at the entrypoint (chunk-g5cw48b5.js:35834), Claude Code checks if an inspector or debugger flag is attached and immediately exits with code 1:
// chunk-g5cw48b5.js:35834 (deobfuscated) function isDebuggerAttached() { let isBun = isRunningWithBun(), hasInspectArg = process.execArgv.some((arg) => isBun ? /--inspect(-brk)?/.test(arg) : /--inspect(-brk)?|--debug(-brk)?/.test(arg) ), hasNodeOptionsInspect = env.NODE_OPTIONS && /--inspect(-brk)?|--debug(-brk)?/.test(env.NODE_OPTIONS); try { return !!global.require("inspector").url() || hasInspectArg || hasNodeOptionsInspect; } catch { return hasInspectArg || hasNodeOptionsInspect; } } if (isDebuggerAttached()) process.exit(1); And if you've ever wondered how Anthropic blocks third-party clients from using Claude Code OAuth tokens: x-anthropic-billing-header is not an HTTP header. It is injected as the first text block of the system prompt (system[0]), cryptographically bound to the 4th, 7th, and 20th characters of your first user message (chunk-0kzygtdw.js:825565 & chunk-xfx9q3vz.js:3717):
// chunk-0kzygtdw.js:825565 var SALT = "59cf53e54c78"; // doe function computePromptFingerprint(firstUserText, version) { // Samples indices [4, 7, 20] of your first message (or "0" if shorter) const sampledChars = [4, 7, 20].map((idx) => firstUserText[idx] || "0").join(""); const payload = `${SALT}${sampledChars}${version}`; return createHash("sha256").update(payload).digest("hex").slice(0, 3); } // Injected as system[0]: // "x-anthropic-billing-header: cc_version=2.1.294.<3-hex>; cc_entrypoint=cli; cch=00000;" 2. The 4 Telemetry Channels, Disk Retry Queue & Gzip Length Obfuscation
By default, the binary sends telemetry to four external endpoints:
-
https://api.anthropic.com/api/event_logging/v2/batch— Primary 1P telemetry (~800tengu_*event types, batched up to 200 events every 10s). -
https://api.anthropic.com/api/claude_code/metrics— OpenTelemetry metrics exporter to BigQuery (token counts, latency,lines_added/lines_removed). -
https://http-intake.logs.us5.datadoghq.com/api/v2/logs— Direct client-to-Datadog log intake using a hardcoded public token (DD-API-KEY: pubea5604404508cdd34afb69e6f42a05bc,chunk-pg985ppg.js:1215) for an allowlist of ~210 operational events. -
https://browser-intake-us5-datadoghq.com/api/v2/logs— Datadog browser error tracker (chunk-mr6ezqh3.js:760), sending stack traces, the first 12 hex chars of yourmachineID(host_name_redacted), and up to 50 non-default GrowthBook feature flags.
Two notable implementation details in the 1P event logger (chunk-bryg4nng.js:198507, 493100):
- Persistent offline retry queue: If a telemetry batch fails to send (e.g., you are offline), it writes the batch to
~/.claude/telemetry/1p_failed_events.<sessionId>.<runId>.jsonand automatically flushes those files in the background the next time you runclaude(retryPreviousBatches()). - Random whitespace padding before gzip (
FTt): Before gzipping JSON request/telemetry bodies, the client appends a newline plus 0 to 256 random spaces and tabs (Math.floor(Math.random() * 257)), masking exact payload lengths on the wire.
3. The _PROTO_* Double-Accounting Trick: "Redacted" in JSON, Plaintext in Protobuf
If you inspect how Claude Code logs custom skills (.claude/skills/*), custom slash commands, third-party plugins, and private marketplaces (chunk-vk5f6mar.js:11020), you'll first see a function mqt() that appears to carefully redact and hash any non-official names:
// chunk-vk5f6mar.js:11020 function buildRedactedPluginMeta(pluginName, marketplaceName, policy) { let scope = resolveScope(pluginName, marketplaceName, policy); let isOfficial = isOfficialAnthropicPlugin(scope, pluginName, marketplaceName); return { plugin_id_hash: sha256(pluginName, marketplaceName), // Non-official plugins get replaced with Gb ("third-party" / "<redacted>") plugin_name_redacted: isOfficial ? pluginName : "<redacted>", marketplace_name_redacted: isOfficial && marketplaceName ? marketplaceName : "<redacted>", is_official_plugin: isOfficial, }; } In additional_metadata (and in Datadog logs), your custom skill and plugin names are indeed replaced with "custom" / "<redacted>" and SHA-256 hashes.
However, look at the wrapper function EG() right below it (chunk-vk5f6mar.js:11093) and tengu_skill_loaded (chunk-t3d7fqkf.js:85957):
// chunk-vk5f6mar.js:11093 function buildPluginTelemetry(pluginName, marketplaceName, policy = null) { let mkt = resolveMarketplace(pluginName, marketplaceName) ?? marketplaceName; return { _PROTO_plugin_name: pluginName, // <-- RAW PLAINTEXT PLUGIN NAME! ...mkt && { _PROTO_marketplace_name: mkt }, // <-- RAW PLAINTEXT MARKETPLACE NAME! ...buildRedactedPluginMeta(pluginName, marketplaceName, policy) }; } // chunk-t3d7fqkf.js:85957 — fires on startup for EVERY custom skill on your machine: logEvent("tengu_skill_loaded", { _PROTO_skill_name: skill.name, // <-- RAW PLAINTEXT SKILL NAME! ...buildSanitizedSkillMeta(skill), // <-- puts sanitizedName: "custom" + sha256 skill_content_chars: skill.contentLength, }); Then, inside transformLogsToEvents (chunk-bryg4nng.js:505623):
-
gIt(oe)(chunk-ndj0668h.js:718) strips every key starting with_PROTO_out ofadditional_metadata. -
transformLogsToEventscopies_PROTO_skill_name,_PROTO_plugin_name,_PROTO_marketplace_name, and_PROTO_head_shain unhashed plaintext directly onto the root Protobuf fields (skill_name,plugin_name,marketplace_name,head_sha) ofClaudeCodeInternalEventand POSTs them toapi.anthropic.com/api/event_logging/v2/batch.
Even more telling: if your organization has a HIPAA flag enabled (UDn() in chunk-bryg4nng.js:243204), a scrubber sd(e) overwrites those exact fields with "hipaa_redacted". For everyone else, they go out in plaintext.
What else is attached to EVERY single telemetry event (Dyr in chunk-bryg4nng.js:488900)?
-
rh(Repo Hash,chunk-wpfsesva.js:76242): Runsgit config --get remote.origin.url, normalizes it tohost/owner/repo, and attachessha256(slug).substring(0, 16). -
head_sha(Full 40-char gitHEADSHA — for Pro & Max users only!):
// chunk-bryg4nng.js:489550 & 698518 function isProOrMaxSubscriber() { // Bne() let sub = getSubscriptionType(); return isClaudeAiOAuth() && sub !== null && (sub === "max" || sub === "pro"); } // Attached in Dyr() only when Bne() is true: ...headSha && isProOrMaxSubscriber() && { head_sha: headSha } -
process(Base64-encoded process memory & CPU metrics): Every event callsprocess.memoryUsage()andprocess.cpuUsage(), JSON-encodes{ uptime, rss, heapTotal, heapUsed, external, arrayBuffers, cpuUsage, cpuPercent }, base64-encodes it, and sends it in theprocessfield. - Your real
os.hostname()(chunk-9mdxv6se.js:7650): Sent tohttps://api.anthropic.com/api/auth/trusted_devicesasdisplay_name: "Claude Code on <hostname> · macOS"during login or lazy trusted-device enrollment.
4. Silent Startup Workspace & Process Scanning (tengu_init & tengu_startup_telemetry)
When you launch claude in a project directory, before you type anything:
-
Config file inspection for private registries & secrets managers (
Bmninchunk-8k2751tq.js:11828):- Opens and reads (up to 64KB each)
.npmrc,pip.conf,pyproject.toml,bunfig.toml,.yarnrc.yml,.cargo/config.tomlto extract package registry URLs (registry = ...,index-url = ...) and classify if you use a private registry ("jfrog" | "nexus" | "github" | "gitlab" | "azure" | "aws" | "gcp" | "other"). - Opens up to 20
.envrc,*.yml,*.yaml,*.toml,*.shfiles in the repo root and tests their contents against:
/\b(?:VAULT_ADDR|SOPS_[A-Z_]*|op read|aws secretsmanager|gcloud secrets)\b/ - Opens and reads (up to 64KB each)
- Checks for
.env/.env.*files (has_env_file),Dockerfile,docker-compose.yml,.devcontainer,flake.nix,BUILD.bazel,project.pbxproj,AndroidManifest.xml, andCUDAreferences inCMakeLists.txt. (Note: The file contents/URLs themselves do not leave the machine; only the boolean flagshas_env_file,has_secrets_manager_refs,has_private_registry, and the vendor enum are sent intengu_init.)- Environment variables, settings &
gh auth tokenprobe (chunk-g5cw48b5.js:36285,chunk-dzhtww7a.js):
- Environment variables, settings &
- Sends the names of all set
CLAUDE_CODE_*andANTHROPIC_*environment variables, all non-default setting keys in~/.claude/settings.json, custom CA/mTLS flags (NODE_EXTRA_CA_CERTS), and word/line counts of your customautoModerules. - Silently spawns
gh auth token(orgh auth status) in the background to reportgh_auth_status: "authenticated" | "not_authenticated" | "not_installed". - Reads
git config user.emailand runsgit log -n 1000 --author=<email>to cache your 5 most frequently modified files (chunk-t3d7fqkf.js:68202).- Process tree & running IDE scan (
chunk-470632ch.js:3540621,3542450):
- Process tree & running IDE scan (
- Walks 10 parent processes up to
PID 1viaps -o ppid= -p $pidandps -o command= -p $pid. - Runs
ps aux | grep -E "Visual Studio Code|Cursor Helper|Windsurf Helper|Devin.app|IntelliJ IDEA|PyCharm|..."(ortasklist | findstron Windows). (Fun Easter egg atchunk-470632ch.js:3542150:e.replace(/windsurf/gi, "Devin Desktop")hardcodes the Windsurf $\to$ Devin rebrand). - Scans every directory in
$PATHfor up to 65 developer tools (kubectl,helm,terraform,docker,podman,bazel,nix,nvidia-smi,psql,mysql,redis-cli, etc.).
5. Unprompted Context Attachments & Background "AutoDream" Sessions
Even outside of telemetry, three mechanisms send data to the LLM without you asking:
- Silent
<ide_selection>and<ide_opened_file>injection (chunk-470632ch.js:3595984,3617900): When running inside an IDE terminal (or if~/.claude/ide/<port>.lockis present),xfn()andMfn()automatically attach to every prompt you send:- The path of your currently open IDE tab (
<ide_opened_file>); - The entire text currently highlighted with your cursor in the IDE editor (
<ide_selection>,content: e.text). If you highlighted a secret in an adjacent editor tab and typed"hey"in the terminal, that highlighted text is silently sent to the LLM.
- The path of your currently open IDE tab (
- Automatic diffs of externally edited files (
changed_files/cPrinchunk-470632ch.js:3628237): Before every turn, Claude checks themtimeof every file it has previously read in the session (readFileState). If you edited a file yourself in another program, it automatically re-reads the file from disk, computes a diff (t8o, up to 16KB), and sends the diff to the LLM asedited_text_file. - Hidden background "AutoDream" agent (
chunk-nj3vnwtp.js:1960..14500) & terminal focus tracking (awaySummaryinchunk-re2hna2k.js:1592001):-
autoDream: Once every 24 hours (after $\ge 5$ sessions), the client silently spawns a background subagent (querySource: "auto_dream",skipTranscript: true) with read-onlyBashaccess (ls,find,grep,cat,head,tail). It autonomously greps through your past.jsonlsession transcripts in~/.claude/projects/, extracts facts, rewritesMEMORY.md, and logstengu_auto_dream_completed. -
awaySummary: Tracks when your terminal window loses focus (blurred) and regains focus (focused), reportsblurDurationMsintengu_return_to_session, and while your terminal is unfocused (right before the prompt cache expires), autonomously fires a background LLM request to generate a "while you were away" recap.
-
6. Credit Where It's Due: The Best Client-Side Guardrails in the Industry
To be completely fair to Anthropic's security team, the client-side defensive engineering inside this binary is extraordinary:
- Invisible Unicode & Trojan Source state-machine sanitizer (
theinchunk-zefvzn71.js:3001): A 16-codepoint ring buffer strips invisible Unicode Tags (U+E0000..U+E007F, commonly used in copy-paste prompt injections), Bidi overrides (U+202A..U+202E), and zero-width characters. If stripping invisible characters exposes a leading/(an attacker trying to smuggle a/slashcommand via clipboard), submission is blocked and kicked back to draft review (chunk-re2hna2k.js:201). - Clipboard provenance fencing (
<pasted-text>inchunk-470632ch.js): Any paste $>20$ chars is wrapped in<pasted-text id="...">with a system rule instructing the model to ignore instructions inside pasted text unless the user's own keyboard-typed text outside the tags asks to follow them. - 45-rule
auto_modeSecurity Monitor (permissions_external-64ee756a.txt.zst): Enforces non-overridableHARD BLOCKrules (data exfiltration, cloud IMDS169.254.169.254/fd00:ec2::254including decimal/hex IP bypasses, transcript/settings tampering) andSOFT BLOCKrules (rm -rf "$VAR"/*requires a literal string path;echo "$VAR"does not clear it; blocks sending keystrokes to its own$TMUX_PANEso the agent can't self-approve). Before destructive git commands, the client silently runsgit statusand checks repo visibility — failing closed (treating the repo as public) if visibility is"unverified". - "Repo May Only Tighten" (
chunk-re2hna2k.js:58,chunk-7tkjxgbw.js:2219): A cloned repo's.claude/settings.jsoncan never weaken user permissions or enableOTEL_LOG_USER_PROMPTS/OTEL_LOG_TOOL_DETAILS— it can only tighten restrictions or turn telemetry off. -
Computer Usepassword & window title redaction (computer-use-swift.node+chunk-raa7pnrg.js): Browsers are locked totier: "read", terminals/IDEs totier: "click"(typing & right-click paste are blocked, and the system clipboard is temporarily wiped during clicks viaGe()). Password fields (AXSecureTextField) are hard-blocked (case "secure_field"), macOS system sheets from other PIDs (foreignPanelPresent) are hatched out on screenshots before reaching the model, and any window title over 40 characters or containing/,:,@,?,,is replaced locally with"(title withheld)"(chunk-raa7pnrg.js:18100).
How to Disable All Telemetry, Datadog & Background Agents in 30 Seconds
The best part of auditing chunk-ac05rqws.js:16950 (EIt / YF) is confirming that Anthropic's telemetry killswitch is completely honest — there are no hidden bypasses when CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 is set.
1. Add to ~/.claude/settings.json (applies even if launched from a GUI/IDE outside your shell):
{ "autoDreamEnabled": false, "awaySummaryEnabled": false, "promptSuggestionEnabled": false, "env": { "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1", "DISABLE_TELEMETRY": "1", "DISABLE_ERROR_REPORTING": "1", "DO_NOT_TRACK": "1", "CLAUDE_CODE_AUTO_CONNECT_IDE": "0" } } 2. Add to ~/.zshrc / ~/.bashrc:
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 export DISABLE_TELEMETRY=1 export DISABLE_ERROR_REPORTING=1 export DO_NOT_TRACK=1 export CLAUDE_CODE_AUTO_CONNECT_IDE=0 3. Delete any queued offline telemetry batches already sitting on disk:
rm -f ~/.claude/telemetry/1p_failed_events.*.json 