Skip to content

Feature Request: Auto-reload CLAUDE.md config files when session is continued from context compaction #22085

Description

@vanicliu

Problem Description

When a session runs out of context and is continued via context compaction (automatic summarization), the global and project-level CLAUDE.md configuration files are not reloaded. This causes Claude to "forget" user preferences defined in these config files.

Steps to Reproduce

  1. Create a global config file at ~/.claude/CLAUDE.md with custom rules (e.g., "Always respond in Chinese")
  2. Start a new Claude Code session - the config is loaded correctly
  3. Have a long conversation until context compaction triggers
  4. The continued session receives a summary but does NOT reload the CLAUDE.md files
  5. Claude no longer follows the rules defined in the config files

Expected Behavior

When a session is continued from context compaction, Claude Code should automatically reload:

  • User global config: ~/.claude/CLAUDE.md
  • Project config: ./CLAUDE.md or ./.claude/CLAUDE.md
  • Project rules: ./.claude/rules/*.md

This would ensure user preferences and project rules are consistently applied, even across session continuations.

Suggested Solution

Include instructions in the context compaction summary to reload the CLAUDE.md configuration files at the start of the continued session, similar to how a fresh session automatically loads these files.

Environment

  • Claude Code CLI
  • macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions