Answer: Mount a named volume at `~/.claude` and set `CLAUDE_CONFIG_DIR` to the same path so Claude Code writes `.claude.json` inside the volume, keeping authentication, settings, and session history across rebuilds. Status: Confirmed Entry: tool/claude-code/settings/persist-auth-settings-rebuilds Revision: 2 Digest: sha256:58b110386a4fca60 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:04:04Z Last changed: 2026-11-20T12:20:27Z (per-project volume source: — → claude-code-config-${devcontainerId}) Last verified: 2026-11-20T12:20:27Z Next check: 2026-11-21T12:20:27Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of mount target | /home/node/.claude | [1] | 2026-11-20 config dir env var | CLAUDE_CONFIG_DIR | [1] | 2026-11-20 volume source | claude-code-config | [1] | 2026-11-20 per-project volume source | claude-code-config-${devcontainerId} | [1] | 2026-11-20 Sources: [1] Anthropic. "Development containers". https://code.claude.com/docs/en/devcontainer.md Role: primary. Accessed: 2026-11-20T12:20:27Z Quote: "target=/home/node/.claude,type=volume" (Supports: mount target) Quote: ""CLAUDE_CONFIG_DIR": "/home/node/.claude"" (Supports: config dir env var) Quote: "source=claude-code-config,target=/home/node/.claude,type=volume" (Supports: volume source) Quote: "uses `source=claude-code-config-${devcontainerId}` for this purpose" (Supports: per-project volume source) Published: 2026-11-20T02:57:22Z Snapshot SHA-256: c3f08346262f8e0c0824bca732af96214b896504ee961ecfc19b4f348bdd576e (captured 2026-11-20T12:20:27Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-20T12:20:27Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:20:27Z Last attempt: 2026-11-20T12:20:27Z Notes and limitations: Extracted automatically from a single official source (section "Persist authentication and settings across rebuilds"). Related: https://latestn.com/tool/claude-code/settings/personal-settings-out-of-repo How do I keep my personal Claude Code settings out of a git repository? https://latestn.com/tool/claude-code/settings/plugin-auto-update-timing How does Claude Code decide when to auto-update marketplaces and plugins? https://latestn.com/tool/claude-code/settings/plugin-component-paths How do I specify component paths like commands or hooks in a Claude Code plugin manifest? https://latestn.com/tool/claude-code/settings/mobile-push-notifications How do I enable push notifications for Claude Code sessions on my phone? https://latestn.com/tool/claude-code/settings/mod-settings-env-vars What settings and environment variables can I use to configure Claude Code mods? https://latestn.com/tool/claude-code/settings/pause-archive-delete-project How do I pause, archive, or delete a Claude Code project? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-20T12:20:27Z | changed | per-project volume source: — → claude-code-config-${devcontainerId} | [1] 2026-11-20T12:20:27Z | changed | volume source: — → claude-code-config | [1] 2026-11-20T12:20:27Z | changed | config dir env var: — → CLAUDE_CONFIG_DIR | [1] 2026-11-20T12:20:27Z | changed | mount target: — → /home/node/.claude | [1] 2026-11-20T12:20:27Z | changed | Reference config source: claude-code-config-${devcontainerId} → — | [1] 2026-11-20T12:20:27Z | changed | Per-project isolation variable: ${devcontainerId} → — | [1] 2026-11-20T12:20:27Z | changed | Volume source name: claude-code-config → — | [1] 2026-11-20T12:20:27Z | changed | CLAUDE_CONFIG_DIR value: /home/node/.claude → — | [1] 2026-11-20T12:20:27Z | changed | Volume mount target: /home/node/.claude → — | [1] 2026-11-13T03:04:04Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/settings/persist-auth-settings-rebuilds/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/settings/persist-auth-settings-rebuilds POST: https://latestn.com/dispute/tool/claude-code/settings/persist-auth-settings-rebuilds with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/settings/persist-auth-settings-rebuilds?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I persist Claude Code authentication and settings across dev container rebuilds? Revision 2, last verified 2026-11-20T12:20:27Z. https://latestn.com/tool/claude-code/settings/persist-auth-settings-rebuilds (accessed 2026-11-21T09:59:08Z). @misc{LatestN_tool_claude_code_settings_persist_auth_settings_rebuilds_r2, title = {How do I persist Claude Code authentication and settings across dev container rebuilds?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/settings/persist-auth-settings-rebuilds}}, note = {Revision 2; digest sha256:58b110386a4fca60; last verified 2026-11-20T12:20:27Z; accessed 2026-11-21T09:59:08Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/settings/persist-auth-settings-rebuilds