[FEATURE] Installer should be able to install in a global folder like /usr/local/

Resolved 💬 3 comments Opened Dec 4, 2025 by potyl Closed Feb 5, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When running Claude Code in a CI environment some users might need to preinstall the binary in their docker image. This creates a problem as the installation is often done as root during the setup and results in Claude Code to be installed under ~/.local/ which resolves into /root/.local/:

/root/.local/
|-- bin
|   `-- claude -> /root/.local/share/claude/versions/2.0.58
|-- share
|   `-- claude
|       `-- versions
|           `-- 2.0.58
`-- state
    `-- claude
        `-- locks

This creates problems as under docker it is recommended to run the under an unprivileged user:

USER runner

That user will not (or should not) have access to /root/.local/.

Copying the binary claude to /usr/local/bin/ is not enough as then claude has problems when trying to run an upgrade.

Proposed Solution

If the installer (and the claude binary) would have an option for installing in a different folder (ex: --prefix or INSTALL_DIR=) this could help CI setups.

Of course, we would still have a problem for a normal user to run claude update, but perhaps the binary could install under the current user's ~/.local/.

Alternative Solutions

_No response_

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

Example scenario:

  1. Dockerfile installs claude as root under /usr/local/ in a multi-stage build named builder
  2. Final stage copies claude files from the multi-stagebuild named builder into its own image
  3. Dockerimage sets a unprivileged user a the current user (ex: runner)
  4. Docker image is built and published
  5. CI/CD runners pulls image and runs workflow
  6. CI workflow references claude from /usr/local/bin/claude and runs as user runner
  7. Workflow decides to update claude
  8. Update works (this is optional, I would understand if the update fails)

Additional Context

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗