[BUG] Project CLAUDE.md re-injected as system-reminder on every tool call (no session deduplication)

Resolved 💬 3 comments Opened Feb 23, 2026 by dkeesey Closed Feb 26, 2026

Description

Project CLAUDE.md files are injected as <system-reminder> blocks on every tool call that reads a file from the project directory, rather than once at session start. There is no within-session deduplication. This causes the same content to appear N times in context — once per tool invocation — consuming tokens proportional to (number of tool calls) × (CLAUDE.md file size).

Steps to Reproduce

  1. Open a project with a CLAUDE.md file (>5KB is easiest to observe)
  2. Start a Claude Code session in that project directory
  3. Run any tool that reads a file in the project: Read, Glob, Grep, Bash (file-touching)
  4. Observe <system-reminder> containing the full CLAUDE.md content in the tool result context
  5. Run another tool in the same session
  6. CLAUDE.md is injected again — full content, second time

Repeat step 5–6 and the content accumulates with each tool call.

Observed Behavior

  • CLAUDE.md is injected once per tool call, not once per session
  • A session with 50 tool calls and a 10KB CLAUDE.md = 500KB of repeated context from CLAUDE.md alone
  • Visible symptom: Claude "repeats whole sections" in responses, as the model sees the same instructions N times and re-echoes them
  • Workaround users are forced to adopt: keep CLAUDE.md files artificially small (<5KB) to contain blast radius — this is not a fix, it's containment

Expected Behavior

  • CLAUDE.md is injected once at session start
  • Subsequent tool calls within the same session do not re-inject content already present in context
  • OR: deduplication of identical <system-reminder> blocks at the rendering layer

Environment

  • Platform: macOS (Darwin 24.5.0)
  • Shell: zsh
  • Observed across multiple project directories and session lengths

Impact

  • Token cost: O(N) context growth per tool call vs O(1) expected
  • Context compaction: Repeated content accelerates hitting context limits, triggering compaction earlier than necessary
  • Model behavior: Repeated instructions cause model to re-echo them in output (visible user-facing bug)
  • Workaround tax: Forces users to artificially constrain CLAUDE.md size, limiting the expressiveness of project-level instructions

Related

  • Issue #27721: Skills from plugins registered twice (similar deduplication failure, different injection point)
  • Issue #23504: Ephemeral File Context to Reduce Context Bloat (downstream mitigation proposal)

View original on GitHub ↗

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