Skip to content

FEAT: separate transient state from persistent state/config #4478

Description

@DarkWanderer

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions