Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By archid21v0.2.1MITIn 1 marketplace
Cuts what Claude reads in Claude Code, and keeps the full version within reach.
Claude loads one when your task matches it, or you run it by name.
1 caution to review before installing
A hook runs when Claude uses the Bash tool
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Cut what Claude reads.
trim is a plugin for Claude Code that makes what Claude reads smaller (screenshots, command output, connector results, repeat file reads, big image files) and keeps the full version one Read away. It also shows what fills your fixed context and what it has saved you.
claude plugin marketplace add archid21/trim
claude plugin install trim@trim --scope user
Status: 0.2.1. Eight features are built and tested; see What you get and What is not built.
MIT license · Python 3.9+, standard library only · works with a Claude subscription (Pro, Max, Ultra) or an API key
Claude re-reads a lot. A full-size screenshot, a 600-line failing test run, a connector answer with base64 attachments and a file Claude already read all land in the context in full, and each one is re-sent with every later request until a compact.
Tokens are your usage. Smaller reads mean fewer tokens used per request: a longer session on a subscription, a smaller bill on an API key.
The full copy stays available. trim never throws a result away. It saves the original to ~/.claude/trim/out/ and tells Claude where it is, so Claude opens it only when it needs the part trim left out.
Estimates, labeled. Token figures are estimates (characters divided by 2.7). The report marks a fixed per-use figure as "assumed".
Trimming these by hand means remembering every time. trim does it before Claude reads them.
| Feature | What it delivers | How to use it |
|---|---|---|
| Half-size browser screenshots | About 75% fewer tokens per screenshot in the desktop app's built-in browser. Clicks still land. | Automatic. Claude can ask for full size with scale: 1. Off: TRIM_BROWSER_SCALE=off. |
| Command output caps | A long test or build run comes back with every failure, every summary line and the last 40 lines. About 80% fewer tokens in one demo (632 lines to 100). Error lines from tsc, npm, git, ESLint and make are kept too, and runs of progress or pass lines become one count line. Exit codes are kept. | Automatic for simple commands (pytest, unittest, jest, npm test, cargo, go, make, tsc and others). Commands with && or | are left alone. Off: TRIM_OUTPUT_CAP=off. |
| Connector result cleanup | Long base64 data, empty JSON fields, repeated lines and runs of progress or pass lines are removed from connector (MCP) results. One demo: 7,595 to 190 characters. Images are left alone. | Automatic for results over 2,000 characters that shrink at least 10%. Off: TRIM_TOOL_CLEANUP=off. |
| Smaller image reads | When Claude reads a big .png or .jpg file (long edge over 1,250 px), it gets a copy at 1,000 px instead. Your file is never changed. Saves about 2,000 tokens on a phone-sized screenshot (estimate). Needs sips (macOS) or ImageMagick. | Automatic. Small text can blur at 1,000 px. Skipped if your settings deny or ask for any Read. Off: TRIM_IMAGE_SHRINK=off. |
| Repeat reads | A second Read of an unchanged file returns a pointer to the earlier text instead of the text again. | Automatic. A third Read goes through, and so does any Read after a compact or clear. Off: TRIM_REPEAT_READS=off. |
| Fixed context check | Shows what fills your fixed context, in tokens per part, and lists the agent types, connectors and plugins this project has not used in 90 days, with where to turn each one off. Changes nothing. | Run /trim:context. |
| Savings report | What trim saved per feature (all time, 30 days, 7 days) and in your last 5 sessions. | Run /trim:report. Logging off: TRIM_SAVINGS=off. |
| Tips | Short session-start rules you choose, such as reading pages as text before taking screenshots. About 59 tokens per session. | Run /trim:setup. Applies from the next session. Untick to remove. |
Every feature, how it works and what it gives you: docs/FEATURES.md.
Plugins from other owners that cover similar ground
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.