Feature request: Attention-aware memory optimization

Resolved 💬 4 comments Opened Apr 8, 2026 by splickz Closed May 21, 2026

Problem

Claude Code's auto-memory and CLAUDE.md files are "store and hope" — text is dumped into context with no verification that the model actually attends to it when relevant queries arise. There's no feedback loop between what's stored and what's retrieved effectively.

Insight

Anthropic has internal access to attention weights, activation patterns, and logprobs that external users don't. This means Anthropic could:

  1. Score each memory note by how strongly it activates when relevant queries hit the context
  2. Identify dead notes that are stored but never attended to
  3. Rewrite notes for saliency — restructure phrasing so the model's attention heads pick them up more reliably
  4. Validate across model versions so memory stays optimized as the model updates

This is the difference between "memory that's stored" and "memory that's verified to work."

Proposed approach

An optimization loop on memory content:

  1. Take existing memory notes
  2. Run simulated test queries against them
  3. Measure: did the model attend to the right context? Did irrelevant notes get surfaced?
  4. Rewrite notes to improve retrieval quality
  5. Repeat until performance plateaus

Essentially — the same way DSPy optimizes prompts, but applied to persistent memory content.

TL;DR

Memory should be verified against the model, not just stored and hoped for. Anthropic has the tools to close this loop — nobody else does.

View original on GitHub ↗

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