Source Intelligence

DisclaimerUnofficial, and not affiliated with Anthropic. Nearly all of this is read straight out of what ships: npm bundles, captured prompts, published docs. Anthropic's own notes go in verbatim, marked as theirs. The rest is my reading, and every entry carries the strings behind it. If one looks wrong, vote it down and say why.

All of v2.1.239 Home All releases olderv2.1.238 v2.1.240newer
Claude Code v2.1.239

Test runs are refused real network access

Under the hood
Useful1 Signal1
Internals not in their notes

Code running under a test runtime cannot make live network calls unless an opt-in variable is set.

CLAUDE_CODE_TEST_ALLOW_REAL_NETWORK
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.

See this entry in the whole of v2.1.239 →