Skip to content

Persistent Claude Code updates across container restarts (workaround + feature suggestion) #17

Description

@satscan1

Problem

When updating Claude Code manually inside the add-on (e.g. via npm install -g @anthropic-ai/claude-code@latest), the update is lost after every restart because the container rebuilds from the image. The add-on sets DISABLE_AUTOUPDATER=1 and the native installer doesn't work on Alpine (musl libc).

This means users are stuck on whatever version is baked into the image until a new add-on release is published.

Workaround

I've found a working solution using /data/npm/ as a persistent install location + a self-installing custom session picker script that symlinks /usr/local/bin/claude to the persistent version on every start.

Full write-up with step-by-step instructions and the complete script:
👉 [paste link to your Gist or the markdown file]

Feature suggestion

It would be great if the add-on natively supported one of these:

  1. Optional DISABLE_AUTOUPDATER — a config toggle like allow_claude_updates: true that removes the DISABLE_AUTOUPDATER=1 env var
  2. Persistent npm prefix — install Claude Code to /data/npm/ instead of /usr/local/ so updates survive restarts
  3. Startup update check — an optional config flag like auto_update_claude: true that runs npm install -g @anthropic-ai/claude-code@latest on start

Any of these would solve the problem without needing the workaround.

Environment

  • Claude Terminal Pro (latest)
  • HA 2026.2.3
  • Claude Code: container ships 2.1.69, latest is 2.1.90

https://gist.github.com/satscan1/d0db5682b8ec91c24bb24b50add8f582

Tnx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions