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

[BUG] claude CLI crash on prompt

Open jvinai opened this issue 10 months ago • 3 comments

Environment

  • Platform (select one):
    • [ ] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [x] Other: Claude Code
  • Claude CLI version: 1.0.6 (Claude Code)
  • Operating System: macOS 15.1.1 (24B91)
  • Terminal: macos Terminal or embeded intellij IDEs terminal

Bug Description

claude used to work perfectly and suddently stopped working with error everytime i type a prompt. The error is:

Error: ENOENT: no such file or directory, open '/Users/jeremyvinai/.claude/projects/-Users-jeremyvinai-Workspace-vp-desktop/7ccaafa3-205a-4311-ba1b-8df28f6ff5fd.jsonl'
    at Module.writeFileSync (node:fs:2352:20)
    at Object.writeFileSync (file:///Users/jeremyvinai/.nvm/versions/node/v21.3.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:1025)
    at y40.appendEntry (file:///Users/jeremyvinai/.nvm/versions/node/v21.3.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:572:24757)
    at y40.insertMessageChain (file:///Users/jeremyvinai/.nvm/versions/node/v21.3.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:572:24498)
    at p31 (file:///Users/jeremyvinai/.nvm/versions/node/v21.3.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:573:1297)
    at file:///Users/jeremyvinai/.nvm/versions/node/v21.3.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1851:1878
    at u7 (file:///Users/jeremyvinai/.nvm/versions/node/v21.3.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:150:21374)
    at pZ (file:///Users/jeremyvinai/.nvm/versions/node/v21.3.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:150:40861)
    at $W (file:///Users/jeremyvinai/.nvm/versions/node/v21.3.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:150:34915)
    at Y5 (file:///Users/jeremyvinai/.nvm/versions/node/v21.3.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:148:4822) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/jeremyvinai/.claude/projects/-Users-jeremyvinai/7ccaafa3-205a-4311-ba1b-8df28f6ff5fd.jsonl'
}

It stay stucks on this error, the input is not displayed anymore. I cannot interact anymore, i must CTRL + C to quit.

Steps to Reproduce

  1. start claude in your terminal
  2. type any prompt

Expected Behavior

Working normally by sending the promp and display claude "thinking" etc

Actual Behavior

Get stuck on this error forever.

Additional Context

Image

I tried uninstalling/reinstalling claude, deleting .claude folder and .claude.json but i still have the issues.

jvinai avatar Jun 03 '25 01:06 jvinai

I fixed it by switching to another node env via nvm, i went from v21.3.0 to v22.16.0.

I can go back to my previous v21.3.0 node version env anytime if you want me to post more information about this bug.

jvinai avatar Jun 04 '25 02:06 jvinai

strange, does the referenced .claude/projects directory exist?

wolffiex avatar Jun 05 '25 16:06 wolffiex

Yes it does. The full path exists except for the destination file when claude is trying to write on it.

jvinai avatar Jun 06 '25 01:06 jvinai

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Oct 10 '25 10:10 github-actions[bot]