
Claude Code’s WebFetch Timeout Fix
We break down the Claude Code 2.1.268 fix for WebFetch hangs, including the new 300-second deadline and the CLAUDE_CODE_WEBFETCH_DEADLINE_MS setting for tuning timeouts in CI. The episode also covers session cleanup for self-hosted runners, JSON output for plugin commands, and tighter local file safety in Cowork sessions.
Chapter 1
Stop WebFetch Tool Hangs with CLAUDE CODE WEBFETCH DEADLINE MS
Lachlan Reed
You are running an automated task in your terminal, everything is humming along nicely, and then... nothing. Total freeze. You check the logs, and it turns out an external HTTP endpoint just kept a response stream open without ever finishing, leaving your agent completely hanging. This lightning talk is brought to you by Jellypod AI. James, mate, Anthropic actually addressed this exact headache in Claude Code version 2.1.268, didn't they?
James Turner
Yeah, they totally did! In the 2.1.268 release notes, Anthropic specifically documented a fix for WebFetch hanging indefinitely on a server that keeps the response open without finishing. So now, by default, a fetch automatically fails after a 300 second, or five minute, hard deadline. And on top of that, they gave us a brand new environment variable, CLAUDE CODE WEBFETCH DEADLINE MS, so you can customize that timeout to whatever fits your setup.
Lachlan Reed
Right, right, which is massive for CI pipelines. Like, five minutes is fine when you are sitting at your desk, but if you are running automated test suites, five minutes of idle waiting is an absolute eternity, mate. So in your pipeline, you can just do export CLAUDE CODE WEBFETCH DEADLINE MS equals 15000, right? That sets a tight 15 second limit so your builds fail fast instead of clogging up runner capacity.
James Turner
Exactly. But you do have to be a little careful with tight timeouts. If you set it to something like 10 or 15 seconds, a slow documentation site or a heavy API endpoint might get cut off mid response, throwing a false failure. And on the flip side, setting the variable to 0 disables the deadline entirely. That can be super useful if you are intentionally monitoring a live local API stream, but if you leave 0 in a headless CI environment, well, you bring back the exact unhandled HTTP hangs that this update was built to fix.
Lachlan Reed
Yeah, back to square one, trailing off into the abyss! Now, version 2.1.268 had a few other subtle quality of life tweaks that caught my eye too. For starters, if you are running self hosted infrastructure, there is a new flag, double dash remove session state, for the self hosted runner command. It automatically purges finished session directories under your sessions folder so your disk space doesn't get clogged up over time.
James Turner
Oh, that is super clean for maintenance. What else was tucked into that build?
Lachlan Reed
They added the double dash json flag to all the claude plugin CLI commands like install, uninstall, enable, and disable, making it much easier to parse plugin statuses programmatically. Plus, they tightened security in local Cowork sessions. The Artifact tool now explicitly refuses to touch local files outside your approved session folders or behind symlinked paths without asking first, keeping local execution super contained. Small tweaks, but man, they make a huge difference in daily reliability.