ClaudeCodeMod

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.

In Claude Code
/plugin marketplace add drkokorev/context-diet
/plugin install context-diet@context-diet
Open the repo

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

Context Diet before and after: a long tool output replaced by a short digest
From the author's repo.

What it hooks into

  • session.startWhen a session starts
  • tool.callAround a tool call, where it can hold one
  • session.appendWhen an entry is written to the transcript
  • command.runWhen you run its slash command/diet
  • ui.closeWhen its pane closes
  • ui.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
Repo
drkokorev/context-diet
Folder
plugins/context-diet
Version
0.3.0
License
MIT
Repo stars
10
Last change
2026-10-09
Language
TypeScript
Files
14

Other mods in Usage

agent-profilerYeonwooSungDraws where a session's time goes, model wait against tools and subagents, in a status line and a live pane, and can write the session out as an OTLP trace.claude-carbongwittebolleDraws the CO2 of each answer and a pane with a pixel molecule colored against your past sessions, plus this session's total under the prompt.dividendMint-SecurityDraws a tip above the prompt about the prompt cache, the context, or the plan limits, with a status line and a /dividend pane of the session's figures.caliber-jev-compactioncaliber-ai-orgReplaces /compact: Jev scores each tool call, drops the stale ones, and keeps the rest of the conversation word for word, then toasts what it kept.model-effort-bandYeonwooSungDraws a band above the prompt with the selected model and the effort of the latest main-conversation request.shuntpleaseaiDraws a band above the prompt with the shared pool's usage and reset times, or this session's rate limits when you are off shunt.optimaizrblendbunjakuHolds a commandDraws this turn's cost, the 5-hour window, and cache time above the prompt, and holds a command that failed twice unchanged.clawdmeterwelternDraws Clawd and the session, weekly, and context bars in a band above the prompt.ccswaperrhythmDraws your ccswap accounts and their 5-hour and 7-day usage, and switches from a button on the band.routeralexei-ledPicks a model and effort for each turn from a classifier, and draws the tier above the prompt.context-budgetmelodic-softwareHolds a commandDraws the session's context by category, in a pane or a band above the prompt, and asks before a settings file is written.extra-modsJhonatan-de-SouzaDraws a menu for Zen, themes, model and effort, and a status line of context, plan limits, and cache.
All 183 in Usage