Memory file duplication causes excessive token consumption

Resolved 💬 2 comments Opened May 25, 2026 by paithana Closed May 26, 2026

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

View original on GitHub ↗

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