[BUG] WebFetch fails with 403 on npmjs.com URLs

Resolved 💬 3 comments Opened Jan 13, 2026 by PaulRBerg Closed Feb 27, 2026

What went wrong?

The WebFetch tool fails with a 403 Forbidden error when attempting to fetch URLs from npmjs.com. This happens because npm blocks AI agents/bots from accessing their package pages.

Example error:

⏺ Fetch(https://www.npmjs.com/package/sablier)
  ⎿  Error: Request failed with status code 403
     ctrl+b to run in background

What should happen?

Either:

  1. Claude Code should not attempt to fetch npmjs.com URLs and inform the user that npm blocks AI agents
  2. Or a user-agent workaround could be attempted (though this may violate npm's ToS)

Steps to reproduce

  1. Start a Claude Code session
  2. Ask Claude to fetch information about any npm package
  3. Claude attempts to use WebFetch on https://www.npmjs.com/package/<package-name>
  4. WebFetch returns 403 error

Environment

  • Version: 2.1.6 (Claude Code)
  • OS: macOS 26.2 (Tahoe)
  • Terminal: WarpTerminal
  • Platform: Anthropic API
  • Model: Opus 4.5

Is this a regression?

Don't know - this may have always been the case since npm blocks bots.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗