Billion Context: Setting Up Infinite-Length Claude Code Sessions Billion Context, an open-source proxy that compresses conversation history between a coding agent and the model API, has reportedly passed 3,700 GitHub stars and 300 forks in about three months by exposing compress, decompress, search-context and status tools so the model itself decides what to fold away. Reported benchmarks on DeepSeek V4.1 Flash show the compressed approach scoring an F1 of 0.31 versus 0.29 for full context on a coding benchmark at roughly 58% lower cost, and surviving every run of a 1.48 million token test in which full context failed all 199 attempts, though exact needle-in-a-haystack recall dropped sharply. The project's paper covers about four and a half months of use — roughly 174,000 model calls and 18.76 billion input tokens — with zero context window overflows reported on 200k-token models, and the proxy installs as a global npm package that can run as a native plugin, client launcher, or generic proxy for OpenAI- or Anthropic-style base URLs. Billion Context: Setting Up Infinite-Length Claude Code Sessions How to install the Billion Context proxy and wire it into Cline Pass and Claude Desktop so long coding sessions stop overflowing or costing too much. What is Billion Context and what problem does it solve? Billion Context is an open source proxy that sits between your coding agent and the model API, compressing conversation history so long sessions stop hitting context window limits. Instead of truncating or blindly summarizing everything at once, it gives the model four tools compress, decompress, search context, and status so the model itself decides what to fold away and what to keep. The project has grown fast on GitHub, reportedly passing 3,700 stars and 300 forks within about three months, and it targets a specific pain point: long-running agent sessions that either blow past their context window https://goremy.ai/blog/articles/what-is-agentic-context-management-a-plain-english-guide or resend the same bloated history on every single turn, racking up token costs along the way. TL;DR - Billion Context is a proxy , not a plugin baked into one agent. You point your agent’s base URL at it, and every request gets compressed before it reaches the real model. - The compression is model-driven and reversible : the agent gets compress, decompress, search context, and status tools, so it chooses what to summarize and can pull exact details back later. - Reported benchmarks on DeepSeek V4.1 Flash show the compressed approach scoring slightly better than full context on a coding benchmark F1 of 0.31 vs 0.29 while costing about 58% less. - On a long-memory benchmark it scored lower than full context overall but well ahead of a retrieval-augmented setup, and in an extreme 1.48 million token test it reportedly survived every run while full context failed all 199 attempts. - The tradeoff is exact recall : needle-in-a-haystack style retrieval of one precise sentence reportedly dropped sharply, since summaries preserve meaning, not verbatim text. - It installs as a global npm package and can run as a native plugin, a client launcher, or a generic proxy you point any OpenAI or Anthropic-style base URL at. - Pairing it with Cline Pass a flat-rate plan for open coding models like DeepSeek V4.1 Flash is a practical way to stretch session limits further, since compression reduces how much history gets resent on every turn. Rapidly build enterprise-grade software applications. How does the compression actually work? Billion Context doesn’t cut off old messages or produce one giant blurry summary the way built-in agent compaction often does. It exposes four tools directly to the model: - Compress folds a range of messages into a detailed summary. - Decompress restores that range when the exact details are needed again. - Search context runs a keyword search across everything that has been compressed. - Status referred to as ACP status reports how full the context is and what’s still available to compress. The model decides when and what to compress, rather than a hardcoded rule firing at some fixed token threshold. Compression also happens incrementally in small ranges instead of all at once, which keeps the prompt cache largely intact. According to the project’s own reporting, a healthy session can sit at a 95 to 97% cache hit rate, with the compression step itself adding 2% or less overhead. That matters because cached tokens are much cheaper than fresh ones, so preserving the cache is a big part of why the approach saves money. What do the benchmarks actually show? The repository includes a paper describing roughly four and a half months of real-world use: about 174,000 model calls and 18.76 billion input tokens, with zero context window overflows reported on 200k-token models. A separate third-party benchmark ran on DeepSeek V4.1 Flash using Context Bench, a coding-agent benchmark built around exploring real repositories. Billion Context reportedly scored an F1 of 0.31 versus 0.29 for full context, at a cost of $4.61 versus $11.05, a roughly 58% cost reduction with a slightly better score. On a long-memory benchmark Long Mem AI , it scored 79.2% compared to 83.2% for full context, but both beat a retrieval-augmented generation RAG baseline at 62.6%, while running at about 71% lower cost than full context. In a stress test using a 1.48 million token session, full context reportedly failed all 199 attempts, while the compressed approach survived every run, achieving roughly 30x compression. The clear weak spot is precision retrieval. On a needle-in-a-haystack test, where the task is pulling back one exact sentence from deep in the history, accuracy reportedly dropped from 69% to 27%. Summarization keeps the gist, not the exact wording, so if a coding agent needs a precise line of code or config value from far back, it has to explicitly decompress that range first. How do you install and set it up? Billion Context installs as a global npm package: npm install -g billion-context --prefix