claude-code - 💡(How to fix) Fix Memory file duplication causes excessive token consumption

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…

Error Message

  • ~/.claude/CLAUDE.md (global) contained project-specific content (41K chars)
  • MEMORY.md duplicated state already in project's KZP.md
  • /doctor flagged files but no automatic deduplication
  • Session used 127K/200K tokens (64%) with minimal actual work

Fix Action

Workaround

Manually trimmed:

  • Global CLAUDE.md to 1K (user prefs only)
  • MEMORY.md to index-only (no state duplication)
  • Removed redundant @imports
RAW_BUFFERClick to expand / collapse

Bug: Memory file duplication causes excessive token consumption

Version: 2.1.150 OS: Debian (Kali Linux)

Problem

Large CLAUDE.md and memory files with duplicate content cause:

  1. Context fills to 64%+ immediately on session start
  2. Autocompact triggers frequently
  3. After compaction, same duplicate content reloads
  4. Tokens consumed on each compact/reload cycle

Observed behavior

  • ~/.claude/CLAUDE.md (global) contained project-specific content (41K chars)
  • MEMORY.md duplicated state already in project's KZP.md
  • /doctor flagged files but no automatic deduplication
  • Session used 127K/200K tokens (64%) with minimal actual work

Expected behavior

  • Warning when global CLAUDE.md contains project-specific content
  • Memory index should not duplicate imported CLAUDE.md content
  • Autocompact should detect and skip duplicate content

Workaround

Manually trimmed:

  • Global CLAUDE.md to 1K (user prefs only)
  • MEMORY.md to index-only (no state duplication)
  • Removed redundant @imports

Token impact

~30K tokens wasted per session on duplicate content loading

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…

FAQ

Expected behavior

  • Warning when global CLAUDE.md contains project-specific content
  • Memory index should not duplicate imported CLAUDE.md content
  • Autocompact should detect and skip duplicate content

Still need to ship something?

×6

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

Back to top recommendations

TRENDING