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 Spec is not the Desktop Spec (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. Labs support:claude code web fetch40 / KD 9 (2026-10-04). Exact disable phrase Labs [GAP] (omitted). 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) — only hit for this name in that file:
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.
Do not expand this Spec into a WebFetch fetch/cache/redirect tour. 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 Spec.
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 — do not invent a 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. Lead with 1. Do not tell the reader that 0 turns WebFetch off — under the general note, 0 would turn the disable behavior off.
[GAP]: no slash command and no dedicated settings key in the sources fetched. Do not invent one.
Not these Specs
Same release train is not the same article.
| Thing | Role | Where |
|---|---|---|
CLAUDE_CODE_DISABLE_WEB_FETCH=1 | Turn WebFetch off (≥2.1.285) | This Spec |
claude --desktop (also added in 2.1.285) | Desktop bridge | Desktop Spec |
| Claude Tag Channels | Channels Spec | Channels Spec |
| Claude Mods / You should know | Mods Spec (2.1.287+; HEAD 2.1.289 is still not this page) | Mods Spec |
WebFetch(domain:…) allow/deny | Permissions deep-dive — different mechanism | Permissions |
| Memory | Unrelated | Memory |
Do not teach a permissions deny rule, cache TTL, or deadline as this Spec's answer. 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(do not invent an upgrade flag). - 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. Soft bridges only: Desktop · Channels · Mods.
Can I use a permissions deny rule instead?
Different Spec. This page's answer is the env var only. Domain rules live on permissions — do not paste a deny-rule recipe here.
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). Do not invent a second 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. Labs support once: claude code web fetch 40 / KD 9; exact disable phrase [GAP].
Live bridges (curl 200, 2026-10-04): Desktop · Channels · Mods · Permissions · Memory.
