[FEATURE] `/context` command should show ALL loaded context, not just Memory files
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
The /context command is intended to help users understand what's loaded into Claude's context window. However, it only shows a subset of what's actually loaded—specifically the "Memory files" (CLAUDE.md and rules). It does not show:
- Hook-injected content — SessionStart hooks can inject significant context via
additionalContextthat doesn't appear in/context - System reminders — Content injected by hooks during the session
- Parent directory CLAUDE.md files — When working in nested directories, CLAUDE.md files from parent directories are loaded but may not all display
- The internal system prompt wrapper — The framing text that introduces user instructions
Proposed Solution
I ran an experiment to catalog everything actually loaded at session start. I found 16 distinct context types totaling ~98KB:
| Context Type | Shown in /context? |
|--------------|---------------------|
| System reminders (hook success messages) | No |
| DateTime injection | No |
| Session ID/path | No |
| Session troubleshooting queries | No |
| Plan formatting instructions | No |
| Hook logging info | No |
| Documentation reference block | No |
| User working directories | No |
| CLAUDE.md consolidation check | No |
| Project structure tree | No |
| CLI documentation check | No |
| Project context (tech stack) | No |
| Recent git activity | No |
| Claude service status | No |
| CLAUDE.md + rules files | Yes |
| IDE context (opened file) | No |
The /context command showed ~10K tokens of "Memory files" but the actual context contained 118K tokens. This 10x discrepancy is confusing.
Alternative Solutions
Enhance /context to show all loaded context, organized by source:
> /context
Context Usage
⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ claude-opus-4-5-20251101 · 118k/200k tokens (59%)
📁 Memory files (9.9k tokens)
├── ~/.claude/CLAUDE.md: 3.0k tokens
├── ~/.claude/rules/security/security.md: 515 tokens
├── ~/.claude/rules/lifecycle/*.md: 5.4k tokens
└── ~/.claude/rules/testing/testing.md: 534 tokens
📁 Project CLAUDE.md files (4.2k tokens)
├── .claude/hooks/CLAUDE.md: 2.1k tokens
└── .claude/hooks/inject-test-methodology/CLAUDE.md: 2.1k tokens
🪝 Hook-injected context (15.3k tokens)
├── SessionStart: inject-datetime: 228 tokens
├── SessionStart: project_structure.py: 650 tokens
├── SessionStart: inject_docs.py: 16.9k tokens
├── SessionStart: plan_template_injector.py: 15.4k tokens
└── ... (show all hooks that contributed)
🔧 System (18.4k tokens)
├── System prompt: 2.9k tokens
├── System tools: 15.5k tokens
└── Internal wrapper: ~100 tokens
💬 Messages (12.7k tokens)
└── Conversation history
⛶ Free space: 82k (41.0%)
⛝ Autocompact buffer: 77.0k tokens (38.5%)
Key improvements:
- Separate sections for each context source type
- Show hook names that contributed context (helps debugging)
- Show parent CLAUDE.md files explicitly with full paths
- Accurate token counts for each section
Priority
High - Significant impact on productivity
Feature Category
CLI commands and flags
Use Case Example
- User sets up SessionStart hooks to inject project documentation
- User notices Claude's responses are slower and context is filling up
- User runs
/contextto diagnose — sees only 10K tokens in "Memory files" - User is confused because behavior suggests much more context is loaded
- User has no visibility into hook contributions or their token costs
- With this feature: User immediately sees hook X is injecting 50K tokens and can optimize
Additional Context
Technical notes
- Hook-injected content comes via
additionalContextin hook responses - This content IS included in the API call but NOT displayed in
/context - The data exists — it's just not surfaced to users
Related debugging need
When hooks inject content, there's currently no way to verify:
- Whether the hook ran successfully
- What content it actually injected
- How many tokens that content consumed
The enhanced /context would solve all of these.
Session data for reference
The experiment that revealed this gap was conducted on 2026-01-05. Full context export available at:/Users/user/Desktop/session/ (16 separate files documenting each context type)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗