Context
Currently, ~/.claude directory contains a mix of:
- Configuration:
CLAUDE.md, agents, commands, settings.json
- Persistent state:
.credentials.json
- Transient state:
todos, shell-snapshots, projects etc. (everything which would not cause an issue if deleted)
Problem
This presents an issue when one wants to share the configuration and persistent state between Claude Code instances running in devcontainers. Particularly:
- Claude configuration (agents, allowed tools, commands, default prompt) is not propagated to container by default
- A first-line workaround to mount
.claude directory writeable in container is:
- Mounting
.claude as read-only is not possible because claude attempts to write it for every operation
- Solutions like dotfiles customization work but are heavyweight and require multiple steps every time a configuration value is adjusted
- In absence of
.credentials.json mounting, reauthentication is required for every new devcontainer or devcontainer rebuild
Proposed solution
Store Claude transient state in ~/.claude-state to separate it from state/settings which are required to be persistent
This will allow to:
- mount
~/.claude directory from the container host (readonly)
- add that mount into
claude-code devcontainer feature, so that devcontainers experience is more straightforward out of the box
Context
Currently,
~/.claudedirectory contains a mix of:CLAUDE.md,agents,commands,settings.json.credentials.jsontodos,shell-snapshots,projectsetc. (everything which would not cause an issue if deleted)Problem
This presents an issue when one wants to share the configuration and persistent state between Claude Code instances running in devcontainers. Particularly:
.claudedirectory writeable in container is:.claudeas read-only is not possible becauseclaudeattempts to write it for every operation.credentials.jsonmounting, reauthentication is required for every new devcontainer or devcontainer rebuildProposed solution
Store Claude transient state in
~/.claude-stateto separate it from state/settings which are required to be persistentThis will allow to:
~/.claudedirectory from the container host (readonly)claude-codedevcontainer feature, so that devcontainers experience is more straightforward out of the box