HolyClaude icon indicating copy to clipboard operation
HolyClaude copied to clipboard

.claude.json is always new when container restarts

Open claudiu-edi opened this issue 6 months ago • 3 comments

Image Variant

Full (latest / dev)

Image Tag / Version

latest

Host OS

Linux

What happened?

After restarting the container, .claude.json.persist file from bind mount is ignored and overwritten by a clear .claude.json file (through entrypoint.sh).

What did you expect?

Persist claude settings from .claude.json file between container restarts.

Steps to reproduce

  1. Run the container with bind mount (./data/claude:/home/claude/.claude) and configure claude related stuff.
  2. Recreate the container.
  3. claude settings do not persist.

Docker Compose / Run command


Logs / Error output


claudiu-edi avatar May 31 '26 23:05 claudiu-edi

Same Problem over here - running the Docker on an Synology NAS. The CLI Update ist only possible in the Docker Terminal - finishing with warnings (Screenhsot attached). I can fix the Error by doing a copy of the dist-server "cd /usr/local/lib/node_modules/@siteboon/claude-code-ui/node_modules/@cloudcli-ai/cloudcli cp -r dist-server/server/* server/"

Image Image

T0MT0M77 avatar Jun 07 '26 09:06 T0MT0M77

I managed a workaround to my initial problem by adding this in compose file: entrypoint: [/usr/local/bin/entrypoint2.sh]

Then, in my custom entrypoint script I've modified:

if [ -f "$CLAUDE_HOME/.claude.json" ]; then
    cp "$CLAUDE_HOME/.claude.json" "$CLAUDE_HOME/.claude/.claude.json.persist"
elif [ -f "$CLAUDE_HOME/.claude/.claude.json.persist" ]; then
    cp "$CLAUDE_HOME/.claude/.claude.json.persist" "$CLAUDE_HOME/.claude.json"
    chown "$PUID:$PGID" "$CLAUDE_HOME/.claude.json"
else
    echo '{"hasCompletedOnboarding":true,"installMethod":"native"}' > "$CLAUDE_HOME/.claude.json"
    chown "$PUID:$PGID" "$CLAUDE_HOME/.claude.json"
fi

to this

if [ -f "$CLAUDE_HOME/.claude/.claude.json.persist" ]; then
    cp "$CLAUDE_HOME/.claude/.claude.json.persist" "$CLAUDE_HOME/.claude.json"
    chown "$PUID:$PGID" "$CLAUDE_HOME/.claude.json"
#elif [ -f "$CLAUDE_HOME/.claude/.claude.json.persist" ]; then
#    cp "$CLAUDE_HOME/.claude/.claude.json.persist" "$CLAUDE_HOME/.claude.json"
#    chown "$PUID:$PGID" "$CLAUDE_HOME/.claude.json"
else
    echo '{"hasCompletedOnboarding":true,"installMethod":"native"}' > "$CLAUDE_HOME/.claude.json"
    chown "$PUID:$PGID" "$CLAUDE_HOME/.claude.json"
fi

claudiu-edi avatar Jun 07 '26 10:06 claudiu-edi

@claudiu-edi @T0MT0M77 fixed in v1.3.6.

The container now restores the saved Claude session before startup can create a fresh default .claude.json, then keeps the live file backed by ./data/claude/.claude.json.persist.

I verified the v1.3.6 Docker publish completed and these tags are live on Docker Hub and GHCR: 1.3.6, 1.3.6-slim, latest, and slim.

Update with:

docker compose pull
docker compose up -d

Please do not post .claude.json, .claude.json.persist, tokens, or full data-directory contents publicly.

Closing this because v1.3.6 covers the restart persistence path directly.

CoderLuii avatar Jun 18 '26 10:06 CoderLuii