Rank #06 · Daily · AI
billion-context: Context-Compression Plugin for Month-Long Agent Sessions
Keep one coding-agent session alive for days by compressing older turns into hierarchical summaries the model can decompress on demand — without claiming a magic bigger window.
What it does
billion-context (bili CLI) is a context-compression layer between many coding agents and their Anthropic/OpenAI-compatible APIs. GitHub description frames it for month-long single sessions, small windows (~100K enough per author), and token savings. Repo ships npm package billion-context.
How it works (README):
- Rewrites streams with acp-kernel compression. The model decides when/what to fold — not a hard truncation knife.
- Injects tools:
compress,decompress,search_context,acp_status— folded ranges stay summarized until restored. - Positioning: incremental, reversible, prefix-cache friendly summaries vs host built-in one-shot summarizers.
- Install:
npm install -g billion-context --prefix=~/.local(or plain-gon user-owned prefixes). Use via native plugin (bili plugin install <client>), launcher (bili <client>), or URL prefix (/bili/on baseURL). - Broad client matrix (pi, OpenCode, Claude Code, Codex, Gemini CLI, Kimi, Hermes, Copilot CLI, Zed, goose, …) with native vs cert-MITM/launcher trade-offs documented in
docs/clients.md.
License note. GitHub API reports NOASSERTION / Other. The in-tree LICENSE (re-read today) is MIT plus an Additional Term — Attribution on Product Surfaces: user-facing products must credit billion-context (and acp-kernel when used) on homepage, docs, or About. Gate and this article list it as MIT + Attribution. Do not call it plain MIT — redistributors of user-facing products must credit billion-context / acp-kernel.
Claims hygiene. README/paper cite author longitudinal studies and third-party benchmark folders (e.g. "5× fewer tokens," cache hit rates, ContextBench scores). TidyHow has not reproduced compression ratios, quality, or cost figures — treat them as project-reported.
Who it's for
- Developers running multi-day / high-turn coding-agent sessions that hit context limits or burn tokens on raw history.
- Power users of Claude Code, Codex, OpenCode, pi, and similar hosts who want plugin-level compression instead of starting a new chat every morning.
- Researchers curious about training-free hierarchical context management (paper lives under
paper/in-repo).
Less ideal if you only do short chats, cannot accept a local proxy/plugin in the request path, or need vendor-supported SLA compression.
Stars / language / license
6,315 stars · TypeScript · MIT + Attribution
Data verified: 2026-11-11 09:05 Asia/Shanghai (GitHub API get_repository + README + LICENSE)
Trending note: +375 stars today (captured 09:01 Asia/Shanghai)
Category tags
AI · context-compression · coding-agents · TypeScript · Claude-Code · Codex · proxy · long-session
How it differs from similar projects
Compared with host built-in compaction / CLAUDE.md summaries. Built-ins are usually one-shot or vendor-specific. billion-context markets tool-driven, reversible, multi-generational compression across many hosts.
Compared with RAG / memory plugins (mem0 and similar). Memory layers store and reinject facts across sessions. billion-context focuses on keeping one live session's prompt window healthy by compressing conversation history in the request path.
Compared with larger context-window models alone. A bigger window delays the problem; this plugin aims to reuse a modest window longer. No independent proof that quality matches full-context for every task.
Caveats. Proxy/plugin MITM or launcher modes have security and ops implications — read client docs. Attribution term applies to redistributed products. Do not cite README benchmark numbers as verified.