Lm Resizer — AI skill for Claude Code
Rust-native context compression for Claude Code, Codex & MCP agents: filters & compresses noisy tool output (tests, diffs, logs, JSON, provider traffic) before it reaches the LLM — fewer wasted tokens.
How to install Lm Resizer
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open phuetz/lm-resizer and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Lm Resizer does
Rust-native context compression for Claude Code, Codex & MCP agents: filters & compresses noisy tool output (tests, diffs, logs, JSON, provider traffic) before it reaches the LLM — fewer wasted tokens, full evidence recoverable. Local-first, Apache-2.0. Pairs with Code Explorer.
Alternatives in AI
- Paritok 4b V1 — Non-destructive compression gateway for AI coding agents 1.4k ★
- Riteway — Simple, readable, helpful unit tests 1.2k ★
- Tokentap — Intercept LLM API traffic and visualize token usage in a real-time terminal dashboard 763 ★
README
lm-resizer
Make **Claude Code** and **Codex** work with less noise, fewer wasted tokens, and more useful context.

One `cargo test` run through `lm-resizer`: **398 commands, 1.23 MB → 372 KB, 222,247 tokens saved** — signal kept, noise dropped, nothing lost (full output stays recoverable).
Website:
French README: [README.fr.md](README.fr.md)
`lm-resizer` is designed for a practical agent problem: Claude Code, Codex, and MCP agents spend a surprising amount of their context window on raw tool output. Its purpose is simple: **save tokens and preserve useful context by removing, compressing, or offloading data the model does not need to reason well**.
When an agent runs commands such as `cargo test`, `npm test`, `git diff`, `rg`, linters, package managers, or provider/API calls, the raw output often contains thousands of repeated, low-value, or structurally noisy lines. Sending all of that to the LLM wastes tokens, fills the context window, and can hide the real error. `lm-resizer` filters and compresses that output before it reaches the agent, while keeping important failures, file paths, summaries, and recovery links visible.
**Why this matters even with large context windows.** Bigger windows (200K, 1M+) don't make noisy output free — they make it *expensive in three ways*: **cost** (you pay per token, every turn), **latency** (more tokens = slower responses), and **attention dilution** — models reason worse when the signal is buried in noise ("lost in the middle"). `lm-resizer` is about **signal density**, not fitting under a size limit: keep what the agent needs to reason, drop the rest, keep the full output recoverable. It can also compress **query-aware** — biasing retention toward the rows relevant to the user's current question when it must drop anything.
**Provider-agnostic, validated live.** lm-resizer sits in front of any OpenAI/Anthropic-compatible API.
Related Skills
Distil
Measure what context compression actually costs an LLM agent: where a session's tokens go, and whether a rewri
Synthelion
Synthelion compresses prompts before they reach any AI model — cutting token usage by up to 70%, reducing API
Openproxy
Smart AI proxy router that connects Claude Code, Cursor, Codex, Copilot, and 50+ coding tools to 40+ AI provid
Claude Codex Cursor Token Saver
AI Coding Token Saver for Windows — optimize prompts and repository context before sending it to Claude, Codex
Mem Compress
rtk-style pre-storage compression — collapses 3+ adjacent identical lines + merges adjacent key: value runs sh
.Git Z2ey1tgs8e
AI Coding Token Saver for Windows — optimize prompts and repository context before sending it to Claude, Codex
Related Agents
Part 19: Repowise — Codebase Intelligence For Coding Agents
60% fewer tokens. 4x faster. Your coding agents stop guessing and start knowing. ---
Ga4 Property
GA4 property configuration auditor. Audits data streams, retention setting, cross-domain config, internal traf
QA Auditor
QA auditor - runs 3 parallel subagents (security, bugs, spec compliance) to audit git diffs against design doc