Progressive Disclosure: Claude-Mem’s Context Priming Philosophy
Core Principle
Show what exists and its retrieval cost first. Let the agent decide what to fetch based on relevance and need.What is Progressive Disclosure?
Progressive disclosure is an information architecture pattern where you reveal complexity gradually rather than all at once. In the context of AI agents, it means:- Layer 1 (Index): Show lightweight metadata (titles, dates, types, token counts)
- Layer 2 (Details): Fetch full content only when needed
- Layer 3 (Deep Dive): Read original source files if required
The Problem: Context Pollution
Traditional RAG (Retrieval-Augmented Generation) systems fetch everything upfront:- Wastes 94% of attention budget on irrelevant context
- User prompt gets buried under mountain of history
- Agent must process everything before understanding task
- No way to know what’s actually useful until after reading
Claude-Mem’s Solution: Progressive Disclosure
- Agent controls its own context consumption
- Directly relevant to current task
- Can fetch more if needed
- Can skip everything if not relevant
- Clear cost/benefit for each retrieval decision
How It Works in Claude-Mem
The Index Format
Every SessionStart hook provides a compact index:- What exists: Observation titles give semantic meaning
- When it happened: Timestamps for temporal context
- What type: Icons indicate observation category
- Retrieval cost: Token counts for informed decisions
- Where to get it: MCP search tools referenced at bottom
The Legend System
- Visual scanning (humans and AI both benefit)
- Semantic categorization
- Priority signaling (🔴 gotchas are more critical)
- Pattern recognition across sessions
Progressive Disclosure Instructions
The index includes usage guidance:- Teaches the agent the pattern
- Suggests when to fetch (critical types)
- Recommends search over code re-reading (efficiency)
- Makes the system self-documenting
The Philosophy: Context as Currency
Mental Model: Token Budget as Money
Think of context window as a bank account:| Approach | Metaphor | Outcome |
|---|---|---|
| Dump everything | Spending your entire paycheck on groceries you might need someday | Waste, clutter, can’t afford what you actually need |
| Fetch nothing | Refusing to spend any money | Starvation, can’t accomplish tasks |
| Progressive disclosure | Check your pantry, make a shopping list, buy only what you need | Efficiency, room for unexpected needs |
The Attention Budget
LLMs have finite attention:- Every token attends to every other token (n² relationships)
- 100,000 token window ≠ 100,000 tokens of useful attention
- Context “rot” happens as window fills
- Later tokens get less attention than earlier ones
- Start with ~1,000 tokens of index
- Agent has 99,000 tokens free for task
- Agent fetches ~200 tokens when needed
- Final budget: ~98,000 tokens for actual work
Design for Autonomy
“As models improve, let them act intelligently”Progressive disclosure treats the agent as an intelligent information forager, not a passive recipient of pre-selected context. Traditional RAG:
- The current task context
- What information would help
- How much budget to spend
- When to stop searching
Implementation Principles
1. Make Costs Visible
Every item in the index shows token count:- Agent can make informed ROI decisions
- Small observations (~50 tokens) are “cheap” to fetch
- Large observations (~500 tokens) require stronger justification
- Matches how humans think about effort
2. Use Semantic Compression
Titles compress full observations into ~10 words: Bad title:- Specific: Identifies exact issue
- Actionable: Clear what to do
- Self-contained: Doesn’t require reading observation
- Searchable: Contains key terms (hook, timeout, npm)
- Categorized: Icon indicates type
3. Group by Context
Observations are grouped by:- Date: Temporal context
- File path: Spatial context (work on specific files)
- Project: Logical context
src/hooks/context-hook.ts, related observations are already grouped together.
4. Provide Retrieval Tools
The index is useless without retrieval mechanisms:search_observations- Full-text searchfind_by_concept- Concept-based retrievalfind_by_file- File-based retrievalfind_by_type- Type-based retrievalget_recent_context- Recent session summaries
format: "index" (default) and format: "full".
Real-World Example
Scenario: Agent asked to fix a bug in hooks
Without progressive disclosure:The Index Entry
- There’s a known gotcha (🔴) about hook timeouts
- It’s related to npm install taking too long
- Full details are ~155 tokens (cheap)
- Happened at 2:14 PM (recent)
The Two-Tier Search Strategy
Claude-Mem implements progressive disclosure in search results too:Tier 1: Index Format (Default)
Tier 2: Full Format (On-Demand)
Cognitive Load Theory
Progressive disclosure is grounded in Cognitive Load Theory:Intrinsic Load
The inherent difficulty of the task itself. Example: “Fix authentication bug”- Must understand auth system
- Must understand the bug
- Must write the fix
Extraneous Load
The cognitive burden of poorly presented information. Traditional RAG adds extraneous load:- Scanning irrelevant observations
- Filtering out noise
- Remembering what to ignore
- Re-contextualizing after each section
- Scan titles (low effort)
- Fetch only relevant (targeted effort)
- Full attention on current task
Germane Load
The effort of building mental models and schemas. Progressive disclosure supports germane load:- Consistent structure (legend, grouping)
- Clear categorization (types, icons)
- Semantic compression (good titles)
- Explicit costs (token counts)
Anti-Patterns to Avoid
❌ Verbose Titles
Bad:❌ Hiding Costs
Bad:❌ No Retrieval Path
Bad:❌ Defaulting to Full Format
Bad:Key Design Decisions
Why Token Counts?
Decision: Show approximate token counts (~155, ~203) rather than exact counts. Rationale:- Communicates scale (50 vs 500) without false precision
- Maps to human intuition (small/medium/large)
- Allows agent to budget attention
- Encourages cost-conscious retrieval
Why Icons Instead of Text Labels?
Decision: Use emoji icons (🔴, 🟡, 🔵) rather than text (GOTCHA, PROBLEM, HOWTO). Rationale:- Visual scanning (pattern recognition)
- Token efficient (1 char vs 10 chars)
- Language-agnostic
- Aesthetically distinct
- Works for both humans and AI
Why Index-First, Not Smart Pre-Fetch?
Decision: Always show index first, even if we “know” what’s relevant. Rationale:- We can’t know what’s relevant better than the agent
- Pre-fetching assumes we understand the task
- Agent knows current context, we don’t
- Respects agent autonomy
- Fails gracefully (can always fetch more)
Why Group by File Path?
Decision: Group observations by file path in addition to date. Rationale:- Spatial locality: Work on file X likely needs context about file X
- Reduces scanning effort
- Matches how developers think
- Clear semantic boundaries
Measuring Success
Progressive disclosure is working when:✅ Low Waste Ratio
✅ Selective Fetching
✅ Fast Task Completion
✅ Appropriate Depth
Future Enhancements
Adaptive Index Size
Relevance Scoring
Cost Forecasting
Progressive Detail Levels
Key Takeaways
- Show, don’t tell: Index reveals what exists without forcing consumption
- Cost-conscious: Make retrieval costs visible for informed decisions
- Agent autonomy: Let the agent decide what’s relevant
- Semantic compression: Good titles make or break the system
- Consistent structure: Patterns reduce cognitive load
- Two-tier everything: Index first, details on-demand
- Context as currency: Spend wisely on high-value information
Remember
“The best interface is one that disappears when not needed, and appears exactly when it is.”Progressive disclosure respects the agent’s intelligence and autonomy. We provide the map; the agent chooses the path.
Further Reading
- Context Engineering for AI Agents - Foundational principles
- Claude-Mem Architecture - How it all fits together
- Cognitive Load Theory (Sweller, 1988)
- Information Foraging Theory (Pirolli & Card, 1999)
- Progressive Disclosure (Nielsen Norman Group)
This philosophy emerged from real-world usage of Claude-Mem across hundreds of coding sessions. The pattern works because it aligns with both human cognition and LLM attention mechanics.

