[BUG] claude code can't access external projects if running via sandboxed environment
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When using Visual Code with the Claude code extension, if we open a project under /run/media/system/<device>/project.
and then ask claude to do a simple whoami:
``Exit code 1``.
Portal call failed: Failed to start command: Failed to execute child process ?source /home/user/.claude/shell-snapshots/snapshot-bash-1777392203949-xdap7g.sh 2>/dev/null || true && { shopt -u extglob || setopt NO_EXTENDED_GLOB; } >/dev/null 2>&1 || true && eval whoami < /dev/null && pwd -P >| /tmp/claude-7620-cwd? (No such file or directory)
What Should Happen?
It should return the username such as: whoami -> user.
Error Messages/Logs
code 1
Portal call failed: Failed to start command: Failed to execute child process ?source /home/user/.claude/shell-snapshots/snapshot-bash-1777392203949-xdap7g.sh 2>/dev/null || true && { shopt -u extglob || setopt NO_EXTENDED_GLOB; } >/dev/null 2>&1 || true && eval whoami < /dev/null && pwd -P >| /tmp/claude-7620-cwd? (No such file or directory).
Steps to Reproduce
- have flatpak version of visual code installed (the same problem emerge if installed via distrobox too)
- open a project that isn't in the root partition, under /run/media/system/<device>/<project>
- ask claude to run
whoami - it should complain that it can't find said file or directory.
Claude Model
Not sure / Multiple models
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
v2.1.121
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗