SlimToken: open-source context compressor cuts 57-64% of tokens before they hit the LLM
Intelligent-Key7357 · reddit · 2026-08-18
A developer released SlimToken, an MIT-licensed open-source token compressor that minifies LLM context reversibly before it reaches the model, so you fit more into the window and pay for fewer tokens. Built on or/xxhash/tiktoken, its token counts use the real cl100k tokenizer.
Three modes: a proxy server (default) that sits in front of Anthropic/OpenAI/Ollama and auto-minifies every request; an MCP server exposing the pipeline as 8 tools; and an Agent Skill + CLI + Python library for Claude Code / Codex / OpenCode.
Pipeline: strips $comment/examples from schemas, collapses repeated banners and whitespace, dedupes repeated toolresults, truncates old assistant prose, enforces a hard token budget, optionally prunes HTML DOM, and type-specifically compresses big tool results. Guarantees: fenced code preserved byte-identical, pair-safety between tooluse/toolresult, zero-copy for unchanged content. There's also a streaming output filter (drops filler like "Sure!", caps runaway completions) and a 1ms pure-CPU prompt rewriter that shrinks a rambling 200-word request to 25 words without a model call.
Measured savings: 57-64% on bloated coding sessions, 83% on HTML dumps — but 0% on clean short sessions, since it only removes redundancy. Ships with VRAM presets (4/8/16GB) and a high-context table (e.g. 898k effective tokens on a 128k MoE row). The author is seeking feedback and contributors.
More from coding & agent
- a16z's Martin Casado: agents still far from production-ready, six failure modes remain — FinanceYF5 · 2026-11-30
- PAL adds E2EE multi-machine remote memory for Claude Code with BYO S3 — rchardkovacs · 2026-11-30
- Reddit asks: did anyone keep autoresearch agent loops in daily workflows? — Jumpy-Cobbler1020 · 2026-11-30
- Dev ports 4 Obsidian plugins to Antigravity native plugins, all open-sourced on GitHub — vista8 · 2026-11-30
- Tactile sensing remains fragmented across 18 sensors; year-long push for a ROS 2 standards working group finds no takers — kscottz · 2026-11-30
- "Harness to Weights": Folding Agent Scaffolding Into a Base VLM Without Gradients — YangYou1991 · 2026-11-30