[BUG] Claude fails to launch when the working directory does not exist, displaying an error message.

Status Closed — not planned
Maintainer reply None cached
Activity 8 comments · opened Jul 18, 2025 · closed Feb 9, 2026

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.55 (Claude Code), although it might have been 1.0.54.
  • Operating System: WSL Ubuntu 22.04 -->
  • Terminal: bash

Bug Description

I created a worktree, launched Claude Code in that directory, and then used a command like "remove" to clean up the worktree. After that, I wanted to run commands like "claude mcp list" or "claude --version", but no matter what arguments I used, I kept getting errors.

Expected Behavior

Regardless of what the specification should be, I think "claude --version" should work regardless of whether you're in the current directory or not.

Additional Context

ubuntu@roku-pc:~/workbench/projects/claude-code-event-notifier-bugfix$ claude --continue
node:internal/bootstrap/switches/does_own_process_state:142
    cachedCwd = rawMethods.cwd();
                           ^

Error: ENOENT: no such file or directory, uv_cwd
    at wrappedCwd (node:internal/bootstrap/switches/does_own_process_state:142:28)
    at NZB (file:///home/ubuntu/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:33710)
    at file:///home/ubuntu/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:34317
    at ModuleJob.run (node:internal/modules/esm/module_job:329:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'uv_cwd'
}

Node.js v22.17.0
ubuntu@roku-pc:~/workbench/projects/claude-code-event-notifier-bugfix$ claude --continue
node:internal/bootstrap/switches/does_own_process_state:142
    cachedCwd = rawMethods.cwd();
                           ^

Error: ENOENT: no such file or directory, uv_cwd
    at wrappedCwd (node:internal/bootstrap/switches/does_own_process_state:142:28)
    at NZB (file:///home/ubuntu/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:33710)
    at file:///home/ubuntu/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:34317
    at ModuleJob.run (node:internal/modules/esm/module_job:329:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'uv_cwd'
}

Node.js v22.17.0
ubuntu@roku-pc:~/workbench/projects/claude-code-event-notifier-bugfix$ claude
node:internal/bootstrap/switches/does_own_process_state:142
    cachedCwd = rawMethods.cwd();
                           ^

Error: ENOENT: no such file or directory, uv_cwd
    at wrappedCwd (node:internal/bootstrap/switches/does_own_process_state:142:28)
    at NZB (file:///home/ubuntu/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:33710)
    at file:///home/ubuntu/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:34317
    at ModuleJob.run (node:internal/modules/esm/module_job:329:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'uv_cwd'
}

Node.js v22.17.0
ubuntu@roku-pc:~/workbench/projects/claude-code-event-notifier-bugfix$ claude --version
node:internal/bootstrap/switches/does_own_process_state:142
    cachedCwd = rawMethods.cwd();
                           ^

Error: ENOENT: no such file or directory, uv_cwd
    at wrappedCwd (node:internal/bootstrap/switches/does_own_process_state:142:28)
    at NZB (file:///home/ubuntu/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:33710)
    at file:///home/ubuntu/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:34317
    at ModuleJob.run (node:internal/modules/esm/module_job:329:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'uv_cwd'
}

Node.js v22.17.0
ubuntu@roku-pc:~/workbench/projects/claude-code-event-notifier-bugfix$ claude mcp list
node:internal/bootstrap/switches/does_own_process_state:142
    cachedCwd = rawMethods.cwd();
                           ^

Error: ENOENT: no such file or directory, uv_cwd
    at wrappedCwd (node:internal/bootstrap/switches/does_own_process_state:142:28)
    at NZB (file:///home/ubuntu/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:33710)
    at file:///home/ubuntu/.nvm/versions/node/v22.17.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:542:34317
    at ModuleJob.run (node:internal/modules/esm/module_job:329:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'uv_cwd'
}

Node.js v22.17.0
ubuntu@roku-pc:~/workbench/projects/claude-code-event-notifier-bugfix$ 

View original on GitHub ↗

8 Comments

warpdesign · 1 year ago

I also get this error (on mac):

&gt; claude node:internal/bootstrap/switches/does_own_process_state:142 cachedCwd = rawMethods.cwd(); ^ Error: ENOENT: no such file or directory, uv_cwd
baimamboukar · 11 months ago

I am coming across the same issue, any fix for this, yet ?

github-actions[bot] · 10 months ago

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.

weeps1 · 10 months ago

Issue happened from my end with the following error:

`claude
node:internal/bootstrap/switches/does_own_process_state:142
cachedCwd = rawMethods.cwd();
^

Error: ENOENT: no such file or directory, uv_cwd
at wrappedCwd (node:internal/bootstrap/switches/does_own_process_state:142:28)
at Fo2 (file:///home/user/.nvm/versions/node/v22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:9:19669)
at file:///home/user/.nvm/versions/node/v22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:9:26716
at file:///home/user/.nvm/versions/node/v22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:567
at file:///home/user/.nvm/versions/node/v22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:11:227
at file:///home/user/.nvm/versions/node/v22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:567
at file:///home/user/.nvm/versions/node/v22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:12:636
at file:///home/user/.nvm/versions/node/v22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:8:567
at file:///home/user/.nvm/versions/node/v22.12.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:4760:3661
at ModuleJob.run (node:internal/modules/esm/module_job:271:25) {
errno: -2,
code: 'ENOENT',
syscall: 'uv_cwd'
}
`

EDIT: This was fixed after closing the current wsl session and reopening a new one and running claude command

Bruno-Meowtel · 9 months ago

Same issue on my end with Node.js v20.19.5 and Claude Code v2.1.2 on Ubuntu after deleting the ".claude" folder.

Closing the terminal and re-opening it fixed the issue.

github-actions[bot] · 8 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

marcindulak · 8 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

github-actions[bot] · 7 months 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.