output-diet
Reviewed
at commit 1121297
Caution: Saves the full text of every trimmed tool result, which can include secrets, under ~/.claude outside your project and never deletes it.
Trims long shell output, Grep results and subagent reports before Claude reads them (head, tail and error lines kept); the untrimmed text is saved to a file…
0 upvotes
Log in to upvote or save- Made by
- Vedant Andhale
- Pinned commit
-
11212973aab268ed7124737b71c7bb5effbe6af0 - What we checked
-
Shortens long Bash, PowerShell, Grep and subagent results before Claude reads them, keeping the start, the end and error lines, and shows a count of what it trimmed in the status line. The full text of each trimmed result is saved to a file next to Claude Code's own session data under ~/.claude so Claude can open it; those files can contain whatever the command printed and are never deleted. No network.
Review details
Static review of the source at the pinned commit; not run. One hook: session.append with door tool-result, applied to tools Bash, PowerShell, BashOutput, Grep, Agent and Task. Text over 120 lines or 8000 characters is replaced by head (30 lines), up to 40 error-like lines and tail (50 lines) for shell output, the first 100 lines for Grep, and the first 6000 and last 2000 characters for subagent reports; the original text is written first with $.fs.write and the result is only trimmed if the write succeeded. Files go to <config dir>/projects/<project slug>/<session>/tool-results/output-diet-<tool_use_id>.txt when the session transcript is found there, otherwise <config dir>/output-diet/<session>/, where the config dir is CLAUDE_CONFIG_DIR, or USERPROFILE or HOME plus .claude (read through $.env.get). Nothing is deleted afterwards, so saved outputs accumulate. Also uses $.session.id, root and cwd, $.fs.exists and $.ui.status. No network calls, no process execution, no obfuscation. The trimmed text replaces what the model reads; the on-screen transcript keeps the full output per the code comments. Not reviewed: how the host stores the transcript for rewritten results.
- What it uses
-
- Reads your prompts: no
- Sees tool calls: yes
- Blocks or changes tool calls: yes
- Reads or writes files: yes
- Runs programs on your machine: no
- Calls the model (uses tokens): no
- Sends data over the network: no
- Stores data: yes
- Shows something on screen: yes
- Hooked events
Trims long shell output, Grep results and subagent reports before Claude reads them (head, tail and error lines kept); the untrimmed text is saved to a file Claude can open.
Made this mod? Add a badge to your README
Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.
[](https://modsforclaude.com/mods/output-diet/)