ranxianglei/billion-context
A context-compression plugin for month-long single sessions (billions of tokens) ,small context windows (a 100K context is enough) and token savings (5x fewer tokens) .上下文压缩插件,月级长会话会话, 兼顾小窗口(100k上下文足矣)省token(省5倍token) . billion-context is all you need
What it solves
billion-context is a context-compression proxy that prevents long-lived AI coding sessions from exceeding their model's context window. It reduces token usage (up to 5x fewer tokens) and prevents session degradation or death by compressing consumed conversation history into layered, high-fidelity summaries.
How it works
The tool acts as a proxy between an AI agent (such as Claude Code, Aider, or Cursor) and the model API (Anthropic, OpenAI, etc.). It parses requests and responses, applying the acp-kernel compression logic.
Instead of hard truncation, it injects four specific context-management tools into the conversation that the model can call itself:
compress: Folds a range of messages into a detailed summary.decompress: Restores a compressed range when exact details are needed.search_context: Performs keyword searches across summaries and visible messages.acp_status: Provides an overview of context usage and compressible ranges.
Who it’s for
Developers using AI coding agents for long-term projects where conversation history quickly exhausts the context window, leading to increased costs and loss of model coherence.
Highlights
- Incremental and Reversible: Summaries are written in small ranges and can be decompressed on demand.
- Prefix-Cache Friendly: Designed to keep the cache prefix intact to maintain performance.
- Broad Compatibility: Supports a wide array of clients via native plugins, a launcher, or simple URL rewrites.
- Model-Driven: The model decides when and what to compress rather than relying on a fixed limit.
Related
- Project
- Project
- Project
- Project
- Dispatch