[BUG] RangeError: Maximum call stack size exceeded during WebFetch

Resolved 💬 3 comments Opened Jan 9, 2026 by its-clem-fandango Closed Jan 13, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude Code crashes with a stack overflow error when using the WebFetch tool to fetch documentation.

## Notes

  • #9157 is related
  • The crash happens during tool execution, likely in response processing
  • Stack trace shows crash in minified cli.js:3362
  • Terminal left in bad state (iTerm2 focus reporting warning appeared after crash)

What Should Happen?

## Expected Behavior

  • WebFetch should retrieve the webpage content
  • Claude should process the response and continue the conversation
  • Session remains stable

## Actual Behavior

  • Permission prompt appears, but after approval Claude crashes
  • Terminal left in corrupted state
  • Session terminated, conversation context lost

Error Messages/Logs

lib/node_modules/@anthropic-ai/claude-code/cli.js:3362
  `,isMeta:!0}),...A]}async function S79(A,Q){if(MrQ())return;let[{tools:B},G,Z,Y]=await Promise.all([rI1(A),oC(Q),fK(),qF()]),J=Y.gitStatus?.length??0,X=Z.claudeMd?.length??0,I=J+X,D=b9();setTimeout(()=>D.abort(),1000);let W=a1(),K=VHA(Q),V=KHA(K,W),F=await FdA(W,D.signal,V),H=0,E=0,C=0,z=0,O=0,L=G.filter((_)=>!_.isMcp);H=B.length,z=L.length;let M=new Set;for(let _ of B){let j=_.name.split("__");if(j.length>=3&&j[1])M.add(j[1])}E=M.size;try{if(B.length>0){let _=H3(),{mcpToolTokens:j}=await ukA(G,async()=>Q,null,_);C=j}if(L.length>0)O=await kg2(G,async()=>Q,null)}catch{}l("tengu_context_size",{git_status_size:J,claude_md_size:X,total_context_size:I,project_file_count_rounded:F,mcp_tools_count:H,mcp_servers_count:E,mcp_tools_tokens:C,non_mcp_tools_count:z,non_mcp_tools_tokens:O})}

  RangeError: Maximum call stack size exceeded
  (Use `node --trace-uncaught ...` to show where the exception was thrown)

  Node.js v22.14.0

Steps to Reproduce

Steps to Reproduce

  1. Start a Claude Code session
  2. Ask Claude to fetch a webpage (e.g., shadcn-ui documentation)
  3. The WebFetch permission prompt appears
  4. Claude crashes with stack overflow before/during response processing

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.2

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

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