Progressive Disclosure
π Core principle
Show what exists and its retrieval cost first. Let the agent decide what to fetch based on relevance and need.
Information architecture pattern that reveals complexity gradually instead of all at once. The default approach for Context Engineering in agent systems.
ποΈ The three layers
- Layer 1 β Index β lightweight metadata: titles, dates, types, token counts
- Layer 2 β Details β fetch full content only when relevant
- Layer 3 β Deep dive β read original source files if required
Mirrors human cognition: scan headlines before articles, TOC before chapters, filenames before opening files.
βοΈ The problem: context pollution
Traditional RAG dumps everything upfront:
- 35k tokens of past sessions, observations, summaries
- Maybe 2k actually relevant β 6% efficiency
- Wastes attention budget; user prompt buried under history
Progressive disclosure inverts it:
- ~800 tokens of index β agent scans β fetches ~200 tokens on demand
- 100% relevance, 99k tokens free for the actual task
π§© The index format
Compact tabular index showing what exists, when, type, retrieval cost:
| ID | Time | T | Title | Tokens |
|-------|----------|----|------------------------------------------|--------|
| #2543 | 2:14 PM | π΄ | Hook timeout: 60s too short for npm | ~155 |
| #2587 | 12:58 AM | π΅ | Context hook script file is empty | ~46 |
| #2592 | 1:16 AM | βοΈ | Web UI strategy redesigned | ~193 |
Grouped by date (temporal context), file path (spatial context), and project (logical context).
Legend system
Emoji icons signal observation type β visual scanning, language-agnostic, token-efficient:
- π― session-request β userβs original goal
- π΄ gotcha β critical edge case or pitfall
- π‘ problem-solution β bug fix or workaround
- π΅ how-it-works β technical explanation
- π’ what-changed β code/architecture change
- π£ discovery β learning or insight
- π why-it-exists β design rationale
- π€ decision β architecture decision
- βοΈ trade-off β deliberate compromise
π¨ Mental model: context as currency
| Approach | Metaphor | Outcome |
|---|---|---|
| Dump everything | Spending whole paycheck on speculative groceries | Waste, canβt afford whatβs needed |
| Fetch nothing | Refusing to spend any money | Starvation, canβt accomplish tasks |
| Progressive disclosure | Check pantry, list whatβs needed, buy that | Efficiency, room for surprises |
Implementation principles
- Make costs visible β every index row shows token count so the agent makes informed ROI decisions
- Use semantic compression β good titles compress observations into ~10 actionable words. βHook timeout: 60s too short for npm installβ not βObservation about a thingβ
- Group by context β date / file path / project β spatial locality reduces scanning
- Provide retrieval tools β index without
search/timeline/get_observationsis useless
The 3-layer workflow (Claude-Mem)
- Layer 1 β search β
search({ query: "hook timeout", limit: 10 })β returns IDs (~50β100 tokens each) - Layer 2 β timeline β
timeline({ anchor: 2543, depth_before: 3, depth_after: 3 })β narrative arc around an observation - Layer 3 β get_observations β
get_observations({ ids: [2543, 2102] })β full details for selected IDs
Cognitive load theory
- Intrinsic load β inherent task difficulty (unavoidable)
- Extraneous load β burden of poorly-presented information. Traditional RAG adds this. Progressive disclosure minimizes it.
- Germane load β building mental models. Consistent structure (legend, grouping, semantic titles) supports it.
β οΈ Anti-patterns
- β Verbose titles β βInvestigation into the issue where hooks time outβ vs βHook timeout: 60s too short for npm installβ
- β Hiding costs β index without token counts forces the agent to guess
- β No retrieval path β index with no MCP search tools is dead weight
- β Skipping the index layer β fetching IDs
[1..10]blind instead of searching first
Measuring success
- β Low waste ratio β relevant tokens / total context > 80%
- β Selective fetching β index of 50, agent fetches 2β3
- β Fast time-to-relevant β 30s with index vs 90s scanning everything
- β Appropriate depth β depth scales with task complexity
π Key takeaways
- Show, donβt tell β index reveals what exists without forcing consumption
- Cost-conscious β visible retrieval costs enable informed decisions
- Agent autonomy β the agent knows current context better than you do
- 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
The best interface is one that disappears when not needed, and appears exactly when it is.
π Related concepts
- Context Engineering β the broader discipline; progressive disclosure is its core retrieval pattern
- Harness Engineering β wiring up retrieval tools and indexes in practice
- Agent Skills β skills are themselves a progressive-disclosure mechanism (load on demand)
- LLM Knowledge Bases β Obsidian vault here uses index-first navigation (
vault-map.mdβcatalog.mdβ notes) - Token Optimization for Claude Code β tools that operationalize this pattern
- Graphify β knowledge-graph index over arbitrary content
π Further reading
Claude Code Claude Code Best Practice Brain
- Cognitive Load Theory (Sweller, 1988)
- Information Foraging Theory (Pirolli & Card, 1999)
- Progressive Disclosure (Nielsen Norman Group)
Source: Claude-Mem documentation, Progressive Disclosure: Claude-Memβs Context Priming Philosophy.
Template: knowledge_note_info