claude-code - 💡(How to fix) Fix [Feature Request] CLAUDE.md re-injection deduplication for nested contexts [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52949Fetched 2026-04-25 06:16:25
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×5commented ×1

Fix Action

Fix / Workaround

Bug Description CLAUDE.md re-injection dedupe. The harness re-injects nested CLAUDE.mds when the agent crosses back into a subtree. No IDE-side workaround; worth filing as a feature request. Would save ~15k on bouncy investigations if implemented. I use nested claude.mds, and it appears by my agents investigations of token usage, that the claude.mds are being re-injected every time the agent touches the folder, so if they touch a folder 3-5 times during a session, it re-injects the claude.md for that folder every time. Would it be possible to add a flag or toggle to only have the agents get injected with the claude.mds once per session to avoid unnecessary token usage?

Code Example

[]
RAW_BUFFERClick to expand / collapse

Bug Description CLAUDE.md re-injection dedupe. The harness re-injects nested CLAUDE.mds when the agent crosses back into a subtree. No IDE-side workaround; worth filing as a feature request. Would save ~15k on bouncy investigations if implemented. I use nested claude.mds, and it appears by my agents investigations of token usage, that the claude.mds are being re-injected every time the agent touches the folder, so if they touch a folder 3-5 times during a session, it re-injects the claude.md for that folder every time. Would it be possible to add a flag or toggle to only have the agents get injected with the claude.mds once per session to avoid unnecessary token usage?

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 2.1.119
  • Feedback ID: c00ad502-17b0-47d8-9ae6-aa598d5e853f

Errors

[]

extent analysis

TL;DR

Implementing a flag or toggle to limit CLAUDE.md re-injection to once per session could resolve the issue of unnecessary token usage.

Guidance

  • Investigate the agent's behavior when crossing back into a subtree to understand why CLAUDE.md re-injection occurs multiple times.
  • Consider filing a feature request for the addition of a flag or toggle to control CLAUDE.md re-injection frequency.
  • Review token usage patterns to quantify the impact of the proposed fix and prioritize its implementation.
  • Evaluate potential workarounds, such as optimizing agent navigation or folder access patterns, to reduce the frequency of CLAUDE.md re-injection.

Notes

The issue lacks specific technical details about the agent's implementation and the CLAUDE.md re-injection mechanism, making it challenging to provide a definitive solution.

Recommendation

Apply workaround: Implementing a flag or toggle to limit CLAUDE.md re-injection to once per session could significantly reduce unnecessary token usage, as estimated to save ~15k on bouncy investigations.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Feature Request] CLAUDE.md re-injection deduplication for nested contexts [1 comments, 2 participants]