>_ lm-resizer 0.1.0

Less noise.
More useful context.

lm-resizer helps Claude Code and Codex spend fewer tokens on raw logs and more context on reasoning. It filters noisy tool output, compresses provider payloads, and keeps the raw data recoverable when the agent needs it.

Fewer tokenslogs, diffs, JSON
Clearer signalerrors stay visible
Local firstno telemetry
Agent readyCodex · Claude · MCP
Context compression pipeline
Noisy input
INFO running cargo test
DEBUG cache miss abc123
WARN repeated stack trace
ERROR expected `}` at line 87
...
1,284 repeated lines
huge provider JSON payload
diff noise and search output
>_filter
score
offload
Compressed output
SUMMARY
Parser failure in src/parser/mod.rs at line 87.

RELEVANT CONTEXT
85 let item = parse_item(tokens)?;
86 items.push(item);
87 // expected `}`

RECOVERY
[full output: ccr://sha256/...]
Rustsingle local binary
CCRretrieve originals
0 telemetrylocal by default

Why readers should care

AI coding agents are only as useful as the context they can still see. If the window is full of repeated logs, long diffs and raw JSON, the model has less room left for the actual reasoning. lm-resizer keeps the important signal visible while moving bulk data into recoverable local storage.

01

Make failures readable

Errors, warnings, file paths, failing tests and next steps stay visible instead of being buried in raw logs.

02

Save context without losing proof

Large or failed command output can be saved locally and referenced through CCR, so compression does not mean losing evidence.

03

Fit real agent workflows

Use it as a CLI wrapper, MCP server, Codex/Claude hook helper, local proxy, C ABI or WASM package.

Two complementary repositories

Code Explorer and lm-resizer are designed to work together. Code Explorer gives the agent a queryable map of the repository. lm-resizer protects the agent's working context while commands, tools and model providers produce noise. Together: know the codebase, then keep the execution loop clean.

Code Explorer

Answers structural questions: where is the logic, what calls this, what changes if this symbol moves?

lm-resizer

Filters the noisy outputs produced while the agent tests, searches, builds, reviews and calls providers.

Code Buddy toolchain

A practical direction for agentic coding: map the repo, preserve context, orchestrate the work.

Agent alone vs. agent with lm-resizer

The point is not only to compress text. The point is to make Claude Code and Codex easier to trust because the prompt contains less waste and more useful evidence.

WorkflowWithout lm-resizerWith lm-resizer
Shell commandsRaw output floods the promptFiltered output plus raw recovery hint
Build failuresUseful errors buried in repeated logsFailures, files and next steps stay visible
Large JSON / diffsContext gets consumed by structure noiseMinified, summarized or offloaded safely
Claude / Codex sessionsEvery session invents its own filtering habitsShared local compression rules and hooks
Provider proxyingPayloads go upstream as-isOpenAI, Anthropic, Bedrock and Vertex shapes can be previewed or forwarded

Connect Claude Code, Codex and MCP agents

Install project instructions or native hook configs, then route noisy tool output through a consistent local compression layer.

# Native hook configs for Claude Code and Codex
lm-resizer init-native-hooks --client all --project-dir . --force

# Reversible agent guidance blocks
lm-resizer install-hooks --client codex --project-dir . --force
lm-resizer install-hooks --client claude --project-dir . --force
# MCP stdio server
lm-resizer mcp

# Install MCP config where supported
lm-resizer install --client claude --scope project
lm-resizer install --client codex --scope global
Claude CodeCodexCursorAiderOpenCodeany MCP client

Proxy, MCP and local APIs

Run lm-resizer beside your agent as a local service. It can compress direct HTTP requests, OpenAI-compatible routes, Anthropic messages, Bedrock and Vertex route shapes, or expose a small MCP tool surface.

HTTP compression

POST /compress, GET /retrieve/:hash and GET /stats provide a small local API for custom tools.

Provider-compatible proxy

/v1/chat/completions, /v1/responses, /v1/messages, Bedrock and Vertex shapes support preview or upstream forwarding.

Embeddable core

Use the Rust API, C ABI or WASM wrapper when you want the same compression pipeline inside another host.

Quick start

# Build the local binary
git clone https://github.com/phuetz/lm-resizer
cd lm-resizer
cargo build --release

# Compress a file or command output
lm-resizer compress --input tool-output.txt --json
lm-resizer exec --stream -- cargo test
# Run the local proxy
lm-resizer serve --bind 127.0.0.1:8787

# Evaluate real Claude/Codex session logs
lm-resizer discover-sessions --agent all --markdown
lm-resizer eval fixtures/sessions --recursive --markdown

Part of a visible agent-tooling story

lm-resizer is the context-budget layer. Code Explorer maps the codebase, Code Buddy orchestrates coding work, and lm-resizer keeps command output, diffs, logs and provider payloads small enough for agents to use effectively.

Created by Patrice Huetz as part of a practical toolchain for developers who want AI agents to work on real repositories, not just demos.

Built in Rust, local-first, Apache-2.0 licensed, and designed for real Claude Code, Codex and MCP workflows.