UsageTrim is a local CLI and Model Context Protocol (MCP) server designed to significantly reduce the token usage of verbose tool outputs for large language models like Claude Code, Codex, Cursor, and Claude Desktop. It acts as an intelligent filter, cutting unnecessary 'noise' from logs, build outputs, and test results while preserving essential 'signal' like failures and errors. The omitted content is losslessly recoverable by reference from a local cache, allowing developers to improve productivity and make the most of their LLM context windows.
主要功能
01Compatibility with multiple AI agents and platforms (Claude Code, Codex, Cursor, Claude Desktop)
02Lossless recovery of trimmed output by reference via local CCR cache
0310 GitHub stars
04Specialized cutters for common developer tools (e.g., pytest, Docker, cargo, go)
05Token usage measurement and gain analysis for tool outputs
06Session deduplication and spill-to-file for large payloads
使用案例
01Preparing messy logs and stack traces for AI agent analysis with prompt-cache stabilization
02Reducing token usage when feeding build or test logs to LLMs for debugging
03Optimizing input for Claude Code, Codex, and Cursor to keep relevant information within context windows