Log Reducer MCP Server Cuts Token Usage When Claude Code Reads Logs

Log Reducer is an MCP server built specifically for Claude Code that reads log files server-side and sends only reduced output into conversations, preventing raw logs from entering the context window. According to the developer, a 2000-line log represents 20,000+ tokens permanently removed from sessions.
Compression Transforms
The tool runs 19 deterministic transforms to compress logs by 50-90% without making API calls:
- Folds stack traces — keeps code frames while collapsing framework noise
- Deduplicates repeated and near-identical lines
- Filters noise including health checks, heartbeats, progress bars, and Docker boilerplate
- Shortens UUIDs, timestamps, and long URLs
- Detects cycles and collapses repeating multi-line blocks
- Compacts access logs by stripping boilerplate down to method + path + status
Development with Claude Code
The entire project was built using Claude Code. The developer would paste log samples into conversations, Claude would analyze what could be compressed, implement transforms, and verify them against test fixtures. The evaluation workflow in the repository — which involves pasting a log, auto-generating ideal output, diffing against the pipeline, and implementing fixes — was designed to be driven entirely by Claude Code.
Setup and Usage
Install with npm install -g logreducer and add to your .claude/settings.json:
{
"mcpServers": {
"logreducer": {
"command": "npx",
"args": ["-y", "logreducer", "--mcp"]
}
}
}To use: copy a log to your clipboard and type /logdump in Claude Code. The raw log is saved to a temporary file and reduced server-side automatically. You can also point it at files directly, filter by log level, grep with regex, or get structural summaries of large logs.
The tool is free and open source under the MIT license, available on GitHub at launch-it-labs/log-reducer and npm as logreducer.
📖 Read the full source: r/ClaudeAI
👀 See Also

Lean Context: Claude Code Plugin Converts Verbose Docs to Agent-Optimized Files
A free, open-source Claude Code plugin called Lean Context scans project documentation and removes content AI agents can discover through grepping, keeping only essential non-obvious commands, gotchas, and environment quirks. In a .NET e-commerce project test, it reduced 8 documents totaling 1,263 lines to just 23 lines.

Scaffold Framework Addresses Claude Code Memory and Workflow Issues
Scaffold is a 17-skill framework for Claude Code that provides persistent memory, decision enforcement, and workflow gates. It uses a 3-tier model routing system for token savings and can be installed via the Claude Code plugins menu.

bunx ccusage Shows $18,450 in Credits Burned — Flat Plans Absorb the Cost
A user on r/ClaudeAI ran bunx ccusage and discovered $18,450 in credits used in May — 248M input tokens, 42M output tokens, 21.7B with cache reads — while paying only €400/month flat-rate for Claude Code and Codex.

Open-source MCP memory server with knowledge graph and learning features
An open-source MCP server written in Rust provides persistent memory for AI agents with knowledge graph architecture, Hebbian learning, and hybrid search. It's 7.6MB with sub-millisecond latency and works with any MCP-compatible client.