[BUG] "Nested" CLAUDE.md files _not_ added to system context when using `--continue`

Resolved 💬 3 comments Opened Jul 28, 2025 by mikegreiling Closed Aug 15, 2025

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.61
  • Operating System: macOS 15.5
  • Terminal: Ghostty

Bug Description

Claude Code will _not_ re-load any nested CLAUDE.md files that it has within its system context when you resume a previous session.

Steps to Reproduce

  1. Create a project with a nested CLAUDE.md file (e.g. ./src/components/CLAUDE.md). Add some specific directive that makes it easy to detect whether it is loaded within the context window. (e.g. "My super secret password is 'GreenToad524!$'")
  2. Within a Claude Code session, get Claude to read another file in that directory. (e.g. Read(src/components/MyComponent.tsx)
  3. Run the /memory command
  4. Observe that it lists the nested CLAUDE.md memory file:
Memory Files
 L user: ~/.claude/CLAUDE.md
 L project: CLAUDE.md
 L nested: ./src/components/CLAUDE.md
  1. Verify that Claude has access to its contents (e.g. ask it what your "super secret password" is)
  2. Exit claude
  3. Open claude again with claude --continue or claude --resume.
  4. Run the /memory command
  5. Observe that it no longer shows the "nested" CLAUDE.md file
  6. Observe further that the Claude LLM has no awareness of the contents of this file within its system context (e.g. ask it again what your "super secret password" is and it will not know unless it inspects the output tokens from the last time you asked)

Expected Behavior

All of the CLAUDE.md files that were loaded as a part of the session should still be present when a session is resumed.

Actual Behavior

The "nested" CLAUDE.md files that were a part of the session are no longer present when resuming a session.

Additional Context

If you Read the CLAUDE.md file directly (e.g. this file gets loaded, not as a side-effect of Reading another file, but directly being Read(./path/to/CLAUDE.md)), this will behave differently. Claude will still "see" this memory within its context window, but it will see a version of the file as it was when it was initially read, and not incorporate any changes that may have been made to it since the last session was suspended.

Claude does not seem to disambiguate CLAUDE.md files that are Read versus CLAUDE.md files that were injected into the system context via the agent.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗