claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Error: Timeout waiting after 1000ms in claude-code CLI (Node.js v20.19.3)

Open felixg3 opened this issue 6 months ago • 10 comments

Environment

  • Platform (select one):
    • [x] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: 1.0.31 (Claude Code)
  • Operating System: macOS 15.5
  • Terminal: VSCode

Bug Description

node:internal/process/promises:391
    triggerUncaughtException(err, true /* fromPromise */);
    ^

Error: Timeout waiting after 1000ms
    at FC2 (.../cli.js:1366:11718)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async nF5 (.../cli.js:1979:9952)
    at async F (.../cli.js:1979:8806)

Steps to Reproduce

1.	Install Node.js 20.19.3 (e.g. via n)
2.	Install @anthropic-ai/claude-code globally
3.	Run any Claude Code command (e.g. claude -p "<your-prompt>")
4.	Wait ~1–2 minutes
5.	Observe crash with the above stack trace

Expected Behavior

•	No uncaught exceptions
•	CLI should retry or extend timeout if the Claude API takes longer than 1000ms
•	Graceful failure or logging without process crash

Actual Behavior

•	Process crashes during promise resolution
•	Error originates from triggerUncaughtException in node:internal/process/promises
•	The default timeout of 1000ms seems insufficient under regular network/load conditions

Additional Context

Troubleshooting Done • Verified Node version: node -v → v20.19.3 • Confirmed the crash is intermittent but reproducible under normal CLI usage • No relevant environment variables (e.g. BASH_DEFAULT_TIMEOUT_MS) were customized • Homebrew node v24 was unlinked to ensure clean Node environment

felixg3 avatar Jun 23 '25 18:06 felixg3

Same here. Makes Claude Code unusable.

AI-Guru avatar Jun 24 '25 16:06 AI-Guru

So far, this has happened only inside VSCode. Not in a regular terminal.

AI-Guru avatar Jun 25 '25 07:06 AI-Guru

happening in Cursor when using the extension and via terminal within Cursor and very annoying

sergenX1 avatar Jun 25 '25 16:06 sergenX1

Getting this error when asking Claude in VSCode terminal to make a Jupyter notebook exploring a CSV dataset. It makes the notebook but before I can press 1 to accept, it crashes with the above error. Seems that getting stuck on one task (not iterating or moving down a todo list) for more than two minutes is related. Tried exact same prompt in the same codebase in a standalone (not VSCode) terminal and it worked just fine. I am also on Mac, using Python and Node installed via Homebrew.

evdutt avatar Jun 27 '25 02:06 evdutt

Seems similar to this issue (Mac, Claude CLI run in VS Code terminal). I posted a workaround here: https://github.com/anthropics/claude-code/issues/2547

glitchculture avatar Jun 27 '25 03:06 glitchculture

Seems similar to this issue (Mac, Claude CLI run in VS Code terminal). I posted a workaround here: https://github.com/anthropics/claude-code/issues/2547

Interesting. Jupyter notebooks have markdown in them which would explain why I was having that issue.

evdutt avatar Jun 27 '25 13:06 evdutt

Seems similar to this issue (Mac, Claude CLI run in VS Code terminal). I posted a workaround here: https://github.com/anthropics/claude-code/issues/2547

Interesting. Jupyter notebooks have markdown in them which would explain why I was having that issue.

correct i was using jupyter

felixg3 avatar Jun 27 '25 20:06 felixg3

I’m hitting the same 1000 ms timeout crash.

Environment

  • Claude Code CLI: v1.0.31
  • Node.js: v20.19.3 (installed via n, Homebrew Node unlinked)
  • macOS: 15.5 (Apple Silicon)
  • Terminal: VS Code integrated terminal

Jenosize avatar Jun 28 '25 13:06 Jenosize

I have the same issue; Claude crashes crashes at the same point every time I create it when creating Jupyter Notebook.

Environment

Claude Code CLI: v1.0.35 Node.js: v22.14 (using nodenv installed via anyenv) macOS: 15.5 (Apple Silicon) Terminal: VS Code and Cursor

yuji-yasuno avatar Jun 28 '25 23:06 yuji-yasuno

@bcherny please help

Orchid420 avatar Jul 01 '25 00:07 Orchid420

Claude crashes after planning to edit an md file

node:internal/process/promises:394 triggerUncaughtException(err, true /* fromPromise */); ^

Error: Timeout waiting after 1000ms at wC2 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1368:11718) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async nF5 (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1929:11635) at async F (file:///usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js:1929:10489)

Node.js v24.3.0 macOS:15.4 (intel) Terminal: VS Code

mcbeaker avatar Jul 08 '25 14:07 mcbeaker

This same issue popped up for me and I realized I had recently turn on VSCode's ability to always open Markdown files in "Preview", not the markdown text.

Breaking VSCode settings.json setting

    "workbench.editorAssociations": {   
        "*.md": "vscode.markdown.preview.editor",
    }   

Removing this block from the settings file - (turning off "Automatically open markdown files in preview mode") - fixed the issue for me.

scottwritescode avatar Jul 08 '25 14:07 scottwritescode

same node:internal/process/promises:394 triggerUncaughtException(err, true /* fromPromise */); ^

Error: Timeout waiting after 1000ms at UN2 (file:///root/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1372:13682) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async oL6 (file:///root/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1948:11756) at async J (file:///root/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1948:10610)

Node.js v24.3.0

siri666666 avatar Jul 09 '25 22:07 siri666666