Skip to content

WebFetch restriction and shallow clone preference #21

@Pancake-Q

Description

@Pancake-Q

Describe the bug

There are two related issues here:

  1. The WebFetch tool does not send requests from the user's local machine. Requests are proxied through Anthropic's servers instead. As a result:

    • raw.githubusercontent.com may be reachable from the local browser
    • but the same host can still be blocked from Anthropic's side

    This is a Claude Code / WebFetch network policy limitation, not a problem with the user's local network.

  2. This repository contains many submodules. In that case, shallow cloning should be preferred to reduce setup time and network overhead.


Reproduction

  1. Open a raw.githubusercontent.com URL in a local browser and confirm it works.
  2. Access the same resource through WebFetch and observe that it can fail because the request is made from Anthropic's servers, where that domain may be restricted.
  3. Clone or update a repository with many submodules and observe the unnecessary overhead from full fetches; shallow clone should be preferred.

System Info

System:
    OS: macOS 26.3.1
    CPU: (12) arm64 Apple M2 Max
    Memory: 286.00 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.17.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.6.5 - /opt/homebrew/bin/npm
    pnpm: 10.30.3 - /Users/zhangqi/Library/pnpm/pnpm
  Browsers:
    Chrome: 145.0.7632.160
    Safari: 26.3.1

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Contributions

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions