How do I turn off WebFetch in Claude Code with CLAUDE_CODE_DISABLE_WEB_FETCH?
On Claude Code 2.1.285 or later, set CLAUDE_CODE_DISABLE_WEB_FETCH to 1 to turn WebFetch off. WebSearch stays available. Env only, not a slash command.
On Claude Code 2.1.285 or later, set CLAUDE_CODE_DISABLE_WEB_FETCH to 1 to turn the WebFetch tool off. CHANGELOG 2.1.285 names the variable; the official environment variables page and tools reference state the value 1. WebSearch stays available. There is no separate disable slash command in these sources. This guide is not about Desktop (Desktop), not Channels (Channels), and not Mods (Mods). HEAD on the 2026-10-04 changelog fetch is 2.1.289 and does not change this switch.
TL;DR: Variable:
CLAUDE_CODE_DISABLE_WEB_FETCH. Value:1. Floor: ≥2.1.285. WebSearch stays on. Shell or settingsenvkey only. Checked 2026-10-04.
What the variable does
It turns the WebFetch tool off. It does not turn off WebSearch.
CHANGELOG 2.1.285 (anthropics/claude-code, fetched 2026-10-04) is the only entry naming this variable:
Added
CLAUDE_CODE_DISABLE_WEB_FETCHenvironment variable to turn off the WebFetch tool
That bullet does not state the value. Official env-vars row (same day):
CLAUDE_CODE_DISABLE_WEB_FETCH— Set to1to turn off the WebFetch tool. The WebSearch tool stays available. Requires Claude Code v2.1.285 or later.
Tools reference → WebFetch availability repeats: on v2.1.285 or later, set the variable to 1 to turn WebFetch off.
This page covers the off switch only. Cache TTL (CLAUDE_CODE_WEBFETCH_CACHE_TTL_MS) and deadline (CLAUDE_CODE_WEBFETCH_DEADLINE_MS) change timing — they do not disable the tool.
How to set it
Shell before claude, or the settings env key. Both are on the env-vars page. No other switch is documented for this.
Shell (page pattern export NAME="value", this variable's documented value):
export CLAUDE_CODE_DISABLE_WEB_FETCH=1
claude
Settings — under the generic env key (the docs example JSON uses other variables such as API_TIMEOUT_MS; apply the same key to this name; there is no documented top-level disableWebFetch key):
{
"env": {
"CLAUDE_CODE_DISABLE_WEB_FETCH": "1"
}
}
File scope (env-vars page table only): ~/.claude/settings.json (you, every project) · .claude/settings.json (project, shared) · .claude/settings.local.json (you, this project) · managed settings (org).
On/off spelling: for variables that turn a behavior on or off, docs use 1 / true / yes / on to turn the behavior on and 0 / false / no / off to turn it off. This name is not on the "any non-empty value including 0" exception list. Use 1. Don't set 0 expecting WebFetch to turn off: under the general note, 0 would turn the disable behavior off.
The same 0 trap applies when you turn off structured outputs.
No slash command, no settings key. Anthropic's docs don't describe either for this switch, as of 2026-10-04. The env var is the only documented way.
The Claude moves worth stealing, by email
Workflows tested on real jobs, sent only when they are worth it. Free.
Not these guides
Features from the same release have their own guides.
| Thing | Role | Where |
|---|---|---|
CLAUDE_CODE_DISABLE_WEB_FETCH=1 | Turn WebFetch off (≥2.1.285) | This guide |
claude --desktop (also added in 2.1.285) | Desktop bridge | Desktop guide |
| Claude Tag Channels | Channels | Channels guide |
| Claude Mods / You should know | Mods (2.1.287+) | Mods guide |
WebFetch(domain:…) allow/deny | Permissions deep-dive — different mechanism | Permissions |
| Memory | Unrelated | Memory |
A permissions deny rule, cache TTL, or deadline is not the off switch. Org policy can withhold WebFetch on some Team/Enterprise (and undetermined-plan) sessions until policy loads — if the tool is missing and you did not set the variable, check /status → Organization policy line, or claude doctor outside a session (tools reference). That is a diagnostic, not a substitute for the env var.
Pitfalls
- Expecting a menu toggle these sources do not describe.
- Setting the variable and still seeing WebSearch — working as documented.
- Running Claude Code older than 2.1.285 (confirm with
claude --version). - Confusing "tool missing because org policy has not loaded" with "I set the env var."
- Treating
0as "turn WebFetch off."
FAQ
What do I set?
CLAUDE_CODE_DISABLE_WEB_FETCH=1 on Claude Code ≥2.1.285. Changelog names the variable; env-vars and tools-reference state 1.
Does this turn off WebSearch?
No. The env-vars row says the WebSearch tool stays available.
Is this Desktop, Channels, or Mods?
No. Those have their own guides: Desktop · Channels · Mods.
Can I use a permissions deny rule instead?
That's a different mechanism, covered in the permissions guide. To turn WebFetch off entirely, the env var is the documented way.
Why is WebFetch missing when I did not set the variable?
Check /status for the Organization policy line, or run claude doctor outside a session (tools reference). The env var is the only documented disable path.
Close
Recap: CLAUDE_CODE_DISABLE_WEB_FETCH=1 on ≥2.1.285; WebSearch stays on; shell or settings env only. Sources checked 2026-10-04: CHANGELOG 2.1.285 (file HEAD 2.1.289 is not this feature) · env-vars · tools reference.
Related guides: Desktop · Channels · Mods · Permissions · Memory.
