RangeError: Maximum call stack size exceeded during MCP hook processing
Resolved 💬 3 comments Opened Jan 8, 2026 by YvesMlk Closed Jan 12, 2026
Description
Claude Code crashed with a stack overflow error during what appears to be MCP hook/tool processing. The session was abruptly terminated and returned to the terminal prompt.
Error Message
RangeError: Maximum call stack size exceeded
(Use `node --trace-uncaught ...` to show where the exception was thrown)
Node.js v22.13.0
Context
- Action being performed: Running a bash command (
scpto sync files to a remote server) - When it occurred: After the command completed successfully, during post-tool processing
- Result: Session terminated, returned to shell prompt
Stack Trace (minified)
The visible stack trace showed recursive calls involving:
queryTrackingPostToolUsehookPermissionResulthook_cancelledhook_blocking_errortoolPermissionContext
This suggests infinite recursion in the MCP hook permission/result handling system.
Environment
- Node.js: v22.13.0
- OS: macOS
- Claude Code: Latest version as of 2025-01-08
Reproduction
Difficult to reproduce reliably - happened once during a sync operation that had been run multiple times before without issue.
Screenshot
A screenshot was captured showing the minified JavaScript stack trace before the crash.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗