Stack Overflow in Async Grep Tool Execution

Status Fixed / completed
Maintainer reply ✓ Yes — ashwin-ant
Activity 10 comments · opened May 2, 2025 · closed May 2, 2025
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

Bug Description
Claude tried running a grep tool but got an exception: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
RangeError: Maximum call stack size exceeded
at N21 (file:///Users/maksym.taran/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:505:21550)
at file:///Users/maksym.taran/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:505:22175
at sD4 (file:///Users/maksym.taran/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:505:5071)
at N21 (file:///Users/maksym.taran/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:505:22129)
at file:///Users/maksym.taran/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:505:22175
at sD4 (file:///Users/maksym.taran/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:505:5071)
at N21 (file:///Users/maksym.taran/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:505:22129)
at yV4 (file:///Users/maksym.taran/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:505:22248)
at IT (file:///Users/maksym.taran/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:634:79366)
at x4 (file:///Users/maksym.taran/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:634:79405)
'

Environment Info

  • Platform: macos
  • Terminal: vscode
  • Version: 0.2.99
  • Feedback ID: a6bf5801-52a9-4646-91bf-eec3d32e4e52

Errors

[]

View original on GitHub ↗

10 Comments

ro-savage · 1 year ago

Exact same error on MacOS 0.2.99 using iTerm + Zsh. This time from "mkdir"

Means that Claude code is unusable as it just crashes every time @bcherny

 Bash(mkdir -p src/routes/reports/totals/organizations/queries)…
  ⎿  Running…

╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Bash command                                                                                                                               │
│                                                                                                                                            │
│   mkdir -p src/routes/reports/totals/organizations/queries                                         │
│   Create directories for organizations endpoint                                                                                            │
│                                                                                                                                            │
│ Do you want to proceed?                                                                                                                    │
│   1. Yes                                                                                                                                   │
│ ❯ 2. Yes, and don't ask again for mkdir commands in src/routes/reports✔                                                            │
│   3. No, and tell Claude what to do differently (esc)                                                                                      │
│                                                                                                                                            │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯


This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
RangeError: Maximum call stack size exceeded
    at N21 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:505:21550)
    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:505:22175
    at sD4 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:505:5071)
    at N21 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:505:22129)
    at yV4 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:505:22248)

I've also tried uninstalling and reinstalling which has helped.

iambaseddev · 1 year ago
Exact same error on MacOS 0.2.99 using iTerm + Zsh. This time from "mkdir" Means that Claude code is unusable as it just crashes every time @bcherny `` Bash(mkdir -p src/routes/reports/totals/organizations/queries)… ⎿  Running… ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ Bash command │ │ │ │ mkdir -p src/routes/reports/totals/organizations/queries │ │ Create directories for organizations endpoint │ │ │ │ Do you want to proceed? │ │ 1. Yes │ │ ❯ 2. Yes, and don't ask again for mkdir commands in src/routes/reports✔ │ │ 3. No, and tell Claude what to do differently (esc) │ │ │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason: RangeError: Maximum call stack size exceeded at N21 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:505:21550) at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:505:22175 at sD4 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:505:5071) at N21 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:505:22129) at yV4 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:505:22248) `` I've also tried uninstalling and reinstalling which has helped.

I tried uninstall/install too but after a couple of messages, I am getting the same error again.
@ashwin-ant @bcherny

ballidev · 1 year ago

having the same issue linux

0.2.99 (Claude Code)

happening in various circumstances but has happend many times now today - serious issue - it is almost unusable in this state

ballidev · 1 year ago

have found that whilst you get a stack trace dumped, if you hit up/down arrow a few times the UI is redrawn and you ofetn can continue

ashwin-ant collaborator · 1 year ago

Sorry you're hitting this. Did this only begin with 0.2.99?

ballidev · 1 year ago

yes I think only since 0.2.99

iambaseddev · 1 year ago
Sorry you're hitting this. Did this only begin with 0.2.99?

Yep. Upgraded to 0.2.99 and got the error message.

jordanburke · 1 year ago

I'm getting this error pretty consistently too now.

Edit: In my case it's a node lint command, but same error message

bcherny collaborator · 1 year ago

Fixed in 0.2.100. Restart to update, and thanks for the bug report!

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.