What
The HTTP layer now blocks live requests made from a test runtime unless an opt-in environment variable is set. Developer-facing only; nothing changes for normal CLI use.
Details
- Every request URL is classified as loopback, opted-in or refused. Loopback is always allowed.
- Real access requires
CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK=1, which also prints a stderr notice on each live request. - Refused requests raise a dedicated egress error; redirects are re-checked against the same rules.
- Separate messages cover the blocked case and a missing recorded fixture, each telling the developer how to record one.
Evidence
Run the file via bun run test:file -- <path> with this request mocked, or set CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK=1 for an intentional live probe., test runtimes must not reach the network
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
Names in the bundleCLAUDE_CODE_TEST_ALLOW_REAL_NETWORK
One source agreesOne thing we can check says the same as this entry.
The name it cites is new in this build
New in this build: CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK