[BUG] Installer places binary in VS Code Snap directory, leading to silent uninstallation on Ubuntu

Resolved 💬 1 comment Opened May 31, 2026 by rudikershaw Closed Jul 3, 2026

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 the Claude Code installer is run from within VS Code's integrated terminal on Ubuntu (where VS Code is installed as a Snap package), the installer respects the XDG_DATA_HOME or $HOME environment variables provided by the Snap sandbox.

This causes the binary to be installed into an ephemeral, revision-scoped directory:
~/snap/code/<revision>/.local/share/claude/versions/<version>

Because Snap packages are immutable and old revisions are garbage-collected during updates, this directory is temporary. When VS Code updates and the system cleans up previous revisions (e.g., Revision 243), the directory containing the Claude binary is deleted. The symlink in ~/.local/bin/claude remains but points to a non-existent path, effectively "uninstalling" the tool without user intervention.

What Should Happen?

The installer should detect if it is running inside a Snap sandbox (specifically VS Code) and handle the installation path more robustly:

  1. Detection: Check for $SNAP environment variable or paths matching ~/snap/*/.
  2. Fallback: If detected, override the target directory to install into the user's actual install directory (or some sensible default) (~/.local/share/claude) rather than the Snap's ephemeral data folder.
  3. Alternatively, print a clear warning message and ask the user to install outside of a snap sandboxed app.

Error Messages/Logs

claude: command not found

Steps to Reproduce

  1. Install Ubuntu (24.04 or 26.04) with Snaps enabled.
  2. Install VS Code via the Snap package (sudo snap install code --classic).
  3. Open VS Code and open the integrated terminal.
  4. Run the official Claude Code installer script.
  5. Verify installation works (claude --version). Note that the binary is located at ~/snap/code/<current-revision>/.local/share/....
  6. Trigger a VS Code update (e.g., sudo snap refresh code or wait for auto-update).
  7. Wait for the system to garbage-collect old Snap revisions (or manually remove an old revision if multiple exist).
  8. Run claude --version again. The command will fail with "No such file or directory" because the target path has been deleted by the Snap package manager.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.159

Platform

Other

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

Users who primarily use VS Code's integrated terminal will experience a silent failure of their CLI tool after routine IDE updates.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗