Code running under a test runtime cannot make live network calls unless an opt-in variable is set.
What's wrong with this entry?
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.
- 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.
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.