[BUG] Claude fails to launch when the working directory does not exist, displaying an error message.
Resolved 💬 8 comments Opened Jul 18, 2025 by Rokurolize 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$ This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗