Bun-Level Zig HMAC Request Signing

Description

Previously undocumented DRM mechanism embedded in Claude Code's HTTP request path. The JavaScript layer writes a 5-byte zero placeholder into API request headers. Bun's Zig-based native HTTP stack overwrites those 5 bytes with a computed HMAC hash AFTER the JS runtime has emitted the request, so the hash is never visible to anything running in JavaScript (including debuggers, man-in-the-middle tools running in-process, or captured replays). Effect: a tool that intercepts and replays captured Claude Code API requests will fail HMAC validation even with a valid API key — the hash cryptographically proves the request originated from a genuine Claude Code binary. Functions as a binary-attestation gate for the Anthropic API and explains why non-Claude-Code clients cannot forge traffic simply by swiping an API key out of a process dump.

Key claims

Relations

Sources

src-20260409-09a1b2325b23