All shelves / Mods / Usage
context-diet
By drkokorev
context-diet is a Claude Code usage mod by drkokorev.
Replaces a huge tool output with a short digest and the path of a file that still holds the full text, and /diet opens a panel of what it saved.
Draws
Install
The marketplace name is context-diet.
/plugin marketplace add drkokorev/context-diet /plugin install context-diet@context-diet
It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.
- Version
- 0.3.0
- License
- MIT
- Repo stars
- 10
- Last change
- 2026-10-09
What it can reach
- Draws in the session
- Sees tool calls
Claude Code 2.1.287 or later, in the terminal or the desktop app's Code tab; the regular chat tab of the desktop app does not load mods. There is nothing to set up: /diet demo fills the panel and /diet reset clears it. Outputs from Bash, Grep, Glob, and MCP tools, JSON only for MCP, longer than 8,000 characters become a digest with a note of what was kept and the path to the full output, and /diet 16k changes the threshold. It keeps every failure with its message from the test runners and build tools it knows, such as jest, vitest, pytest, go test, cargo, tsc, and eslint, errors with the lines around them from other logs, the header and the first and last rows of a table, the structure of JSON, every file and hunk of a diff with lockfiles reduced to counts, and grep results and file lists grouped with counts. When the same command runs again, it shows what changed instead. Read, Edit, Write, WebFetch, and MCP answers that are not JSON are never cut, and # diet:off keeps one output whole. /diet opens a panel of the tokens saved, how often Claude reopened a full output, and the latest cuts, and a status line under the prompt counts them.
The marketplace, context-diet, holds only this plugin, from plugins/context-diet. Trimming what a long output costs in context is why this page files it under usage. output-diet, by VedantAndhale, trims what Claude reads from a long shell, search, or subagent result, saves the full text, and counts the savings on the status line. fast-jev-output, by tamaratran, sends a long Bash result to TypeSafe's Jev, which trims it before Claude reads it, and toasts the cut. This one digests on this machine and sends nothing: each cut output is saved whole to .context-diet/out-NNN.txt in the project, which carries its own .gitignore and cycles through 300 names. /diet dry measures without cutting, /diet keep keeps one command's output whole in this project, and a command whose outputs Claude keeps reopening is cut only when twice as long. /diet capture on, off by default, rewrites a single test or build command so its whole output is saved before Claude Code shortens a failing one, and a permission rule may then no longer match it. If anything goes wrong, the output reaches Claude exactly as it came. The author's own test of seven tasks, on synthetic fixtures with one run each and one model, found the same answers in 8 tool calls instead of 13. Its plugin.json names drkokorev as its author.
Demo

What it hooks into
session.startWhen a session startstool.callAround a tool call, where it can hold onesession.appendWhen an entry is written to the transcriptcommand.runWhen you run its slash command/dietui.closeWhen its pane closesui.renderDraws into the sessionPane
Read from the on() calls in its hook modules. Open its source under Files to check what each one does.
Slash commands 1
/dietContext Diet: show what was trimmed, or turn it on/off
Files
The author's README and source, 4 files. They load when you open them.
Facts
- Author
- drkokorev
- Category
- Usage
- Marketplace
- context-diet
- Folder
- plugins/context-diet
- Version
- 0.3.0
- License
- MIT
- Repo stars
- 10
- Last change
- 2026-10-09
- Language
- TypeScript
- Files
- 14