How drkokorev/context-diet works
Context Diet is a Claude Code plugin that reduces large tool outputs to useful digests while preserving access to the full output. The principal workflow intercepts tool output, compresses it, and returns a digest; optional capture mode preserves verbose command output before Claude Code truncates it. The graph includes documented output formats, repeat-run comparisons, reread adaptation, and user controls. Source excerpts show the compressor dependencies and parts of the registration logic; several feature relationships are documented only in the README.
Main entry points: register.tsx Output hook · diet.ts Output compressor · tools.ts Runner parsers · text.ts Text utilities
Components 13
Runtime processing
- Output hook
plugins/context-diet/hooks/register.tsx - Capture mode
plugins/context-diet/hooks/register.tsx
Digest engines
- Output compressor
plugins/context-diet/hooks/diet.ts - Runner parsers
plugins/context-diet/hooks/tools.ts - Text utilities
plugins/context-diet/hooks/text.ts - Format digests
plugins/context-diet/hooks/diet.ts - Repeat-run delta
plugins/context-diet/hooks/diet.ts
Preferences and panel
- Preferences and stats
plugins/context-diet/hooks/register.tsx - Panel and commands
plugins/context-diet/hooks/register.tsx
Claude Code and files
- Claude Code
- Tool output
- Saved full output
Other components
- Claude user
Connections 19
- Claude user → Claude Code: runs tools
README.md - Claude Code → Tool output: produces output
README.md - Tool output → Output hook: intercepts output
README.md - Output hook → Output compressor: compresses output
plugins/context-diet/hooks/register.tsx - Output compressor → Runner parsers: parses runners
plugins/context-diet/hooks/diet.ts - Output compressor → Text utilities: uses helpers
plugins/context-diet/hooks/diet.ts - Output compressor → Format digests: formats digests
plugins/context-diet/hooks/diet.ts - Output hook → Repeat-run delta: compares runs
plugins/context-diet/hooks/register.tsx - Output hook → Saved full output: saves full output
README.md - Output hook → Claude Code: returns digest
README.md - Claude Code → Saved full output: reopens output
README.md - Output hook → Preferences and stats: reads and updates
plugins/context-diet/hooks/register.tsx - Output hook → Panel and commands: updates panel
plugins/context-diet/hooks/register.tsx - Claude user → Panel and commands: uses commands
README.md - Panel and commands → Preferences and stats: changes settings
plugins/context-diet/hooks/register.tsx - Preferences and stats → Output hook: controls cutting
plugins/context-diet/hooks/register.tsx - Claude user → Capture mode: enables capture
README.md - Capture mode → Saved full output: preserves command log
README.md - Capture mode → Output hook: digests saved log
README.md