{
  "id": 765399,
  "title": "Persisting Claude CLI Login Between Container Builds",
  "url": "https://urgent.news/2026/08/13/persisting-claude-cli-login-between-container-builds",
  "topic": "culture",
  "section": "Culture",
  "published": "2026-08-13T12:42:38.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/sukkergris/persisting-claude-cli-login-between-container-builds-55cl"
  },
  "original_language": "en",
  "account": "The Claude Code application stores account and session information in a file named ~/.claude.json. However, this file was not being persisted during container rebuilds, requiring users to re-authenticate every time the container was rebuilt. Mounting a named volume directly onto ~/.claude.json caused issues, as Docker Desktop failed to detect the single file and resulted in an empty directory. To resolve this, the solution was to create a directory, such as ~/.claude-json, mount the named volume onto this directory, and then create a symbolic link from ~/.claude.json to the new directory. The Dockerfile was updated to include these steps, and the post-container-install.sh script ensured proper ownership was set for the new mount. This approach allowed the ~/.claude.json file to persist across container rebuilds, eliminating the need for re-authentication.",
  "summary": "Goal Keep Claude Code's account/session login ( ~/.claude.json ) alive across devcontainer rebuilds, instead of having to re-authenticate every time the image is rebuilt. The problem Claude Code keeps two things on disk: ~/.claude/ — a directory, already persisted via a named Docker volume ( claude-playwright-setup ). ~/.claude.json — a single file holding account/session state, which was not…",
  "key_points": [
    "Claude CLI stores account info in ~/.claude.json",
    "Persistent file lost during container rebuilds",
    "Solution: create directory, mount volume, link file"
  ],
  "editors_take": "This fix ensures users of the Claude Code application no longer have to re-authenticate after each container rebuild, improving their overall experience with the persistent storage of account and session information.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}