[Bug] WebFetch Wildcard Domain Matching Fails to Generalize
Status Fixed / completed
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 13 comments · opened Oct 10, 2025 · closed Aug 19, 2026
Bug Description
"WebFetch(domain:*)", # doesnt work?
...
"WebFetch(domain:developers.google.com)" # still required, but * should have handled it
Environment Info
- Platform: linux
- Terminal: vte-based
- Version: 2.0.13
- Feedback ID: bd5d0ca1-e082-4cdd-9fd4-e1c07ba130e4
Errors
[]Showing cached comments. Read the full discussion on GitHub ↗
12 Comments
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
yes, still broken
Any planned fix for this? super annoying to have to approve every domain
I'm also running into this problem
Regarding the domain prompt: The bug is worse than expected. Even explicit domains like WebFetch(domain:github.com) in the settings.json are not being honored - I still had to manually select option 2. This confirms the bug affects:
The settings.json domain permissions for WebFetch are completely broken. The only workaround is:
It looks like
"WebFetch(domain:*)"does not work, but just adding"WebFetch"on its own does give permission for all domains.I haven't tested this, but I just saw this in Claude Code v2.1.20's release notes:
Ah, so that means there was never any need to use
WebFetch(domain:*),WebFetchwould have been enough. And now, you can useWebFetch(*). Good to know, thanks @blimmer!Clarification around subdomain matching would be nice too. Can I use just a top level domain? What about *.example.com?
Think this is broken again, at least within a sandbox. When approving a permission request, it adds the explicit
WebFetch(domain:xxxx.com)to the settings.json, even though I already haveWebFetchin there. Also tried withWebFetch(*)andWebFetch(domain:*).Yes, seems it's not possible to allow all domains in
WebFetchwhen using sandbox mode?Hook workaround: auto-approve WebFetch by domain
Until the native wildcard matching is fixed (especially in sandbox mode), you can use a PreToolUse hook to auto-approve WebFetch requests based on the URL's domain.
webfetch-domain-allow.sh:Install in
.claude/settings.json:This works in sandbox mode and supports both "allow all" and specific domain allowlists. You can also use the
CC_WEBFETCH_ALLOW_DOMAINSenvironment variable (comma-separated) for domain configuration without editing the script.