Tokentrimmer — Development skill for Claude Code
Local proxy that losslessly shrinks tool output in Claude Code / Anthropic / OpenAI requests before they're sent.
How to install Tokentrimmer
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open an21an21/tokentrimmer and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Tokentrimmer does
Local proxy that losslessly shrinks tool output in Claude Code / Anthropic / OpenAI requests before they're sent. Verified, prompt-cache safe, zero dependencies.
Alternatives in Development
- Breach Check — HIBP k-anonymity check on a password wordlist 4.5k ★
- Claude Code Proxy — Run Claude Code on OpenAI models 3.3k ★
- Dario — A local OpenAI- and Anthropic-compatible proxy that brings your Claude Pro/Max subscription to Cursor, Cline 485 ★
README
TokenTrimmer
[](https://www.npmjs.com/package/tokentrimmer) [](LICENSE) 

**Reduce Claude Code token usage and LLM API cost, without losing information.** TokenTrimmer compresses tool output (JSON, logs, grep results, repeated file contents) in every request before it reaches the Anthropic or OpenAI API, and keeps prompt caching working. Works with Claude Code and Codex.
A local proxy that sits between your app (Claude Code, Codex, the Anthropic or OpenAI SDK, any agent) and the API, and makes each request smaller before it is sent, without changing what the model can read. Zero dependencies, Node 18+, runs on your machine.
your app -> TokenTrimmer (127.0.0.1:8787) -> api.anthropic.com / api.openai.com / chatgpt.com (Codex)
What it does
In an agent session, most of the input tokens are tool output: JSON from APIs, command logs, grep results, the same file or page fetched twice. The whole conversation is sent again on every turn, so that output is paid for over and over. TokenTrimmer rewrites tool results into a shorter form as each request passes through:
- Lossless by default. JSON is minified, arrays of objects become compact tables, log lines that share a pattern store the pattern once, grep output is grouped by directory, and a result or block of lines the model already saw earlier becomes a one-line reference to it. Every encoding has a decoder, and a built-in verifier decodes each rewritten result before the request is sent. If any check fails, the original request goes out unchanged.
- Only tool results are touched. System prompts, tool definitions and the conversation text are sent as is. Results from file tools
Related Skills
Kvguard
Local proxy & TUI that catches 1-token prompt/KV cache prefix misses and auto-heals requests for Anthropic, Op
Skinflint
Local proxy for the Anthropic and OpenAI APIs: hard spend caps for coding agents, a context token profiler, an
Agentrouter
Unofficial SDK for AgentRouter (agentrouter.org) — Claude, DeepSeek, and GLM via OpenAI-compatible proxy. Zero
Abridge
Turn your existing Antigravity, Cursor and OpenCode models into a local OpenAI/Anthropic API for Claude Code,
Metaphor Local Gateway
Use your Metaphor account from any local coding agent — OpenAI/Anthropic-compatible, loopback-only, zero depen
Claude Codex Nebius Proxy
A Claude Code + Codex CLI → Nebius bridge. Accepts Claude /v1/messages and Codex /v1/responses requests, conve
Related Agents
LLM Orchestrator
Use this agent for LLM integration work — prompt engineering, multi-provider abstraction (OpenRouter, Gemini,
Review AI Systems
Product review committee — AI Systems Engineer. Dispatched in P2, P3, P4, P5 (AI system spec), P6, P7 to revie
Grok Agent 01
ONLY job: find free or freemium AI token/API plans (OpenAI-compatible, Anthropic, Google, open routers, studen