# billion-context: Compress Context for Long Coding-Agent Sessions

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/ranxianglei-billion-context
Generated for open source discovery and AI-assisted research.

billion-context is a TypeScript proxy plugin built on acp-kernel that incrementally compresses coding-agent conversations, aiming to fit month-long sessions into smaller context windows. It supports clients including Claude Code, Codex, OpenCode, pi, and Gemini CLI.

GitHub: https://github.com/ranxianglei/billion-context
OSRepos URL: https://osrepos.com/repo/ranxianglei-billion-context

## Summary

billion-context is a TypeScript proxy plugin built on acp-kernel that incrementally compresses coding-agent conversations, aiming to fit month-long sessions into smaller context windows. It supports clients including Claude Code, Codex, OpenCode, pi, and Gemini CLI.

## Topics

- typescript
- ai-agents
- coding-agent
- proxy
- context-compression
- conversation-summarization

## Repository Information

Last analyzed by OSRepos: Thu Oct 22 2026 03:55:36 GMT+0100 (Western European Summer Time)
Detail views: 1
GitHub clicks: 0

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Overview

billion-context is a TypeScript proxy plugin built on **acp-kernel**, a context-compression library from the same project author. It sits between coding agents and model APIs, compressing conversation history into layered summaries to address context-window growth and token costs during long sessions. The project frames its goal as enabling month-long sessions, billions of tokens processed over time, and roughly five times fewer tokens, while using a context window around 100K tokens.

It supports a broad range of clients, including Claude Code, Codex, OpenCode, pi, Gemini CLI, and others. Integration options include native client plugins, launchers, and a `/bili/` base-URL proxy route. Compression is model-driven: the model chooses what to summarize, and compressed ranges can be restored when needed.

## Key Features

- Incrementally compresses conversation ranges into detailed summaries rather than applying a fixed truncation limit.
- Provides `compress`, `decompress`, `search_context`, and `acp_status` context-management tools.
- Supports native plugin, client launcher, and base-URL proxy integration paths.
- Rewrites Anthropic- and OpenAI-shaped API streams and forwards requests to compatible model APIs.
- Includes session tracking, cache-hit reporting, logs, and a local web UI for session and proxy status.
- Offers Docker deployment as well as npm installation.

## Use Cases

- Coding-agent users who want to keep one conversation going across long projects without repeatedly starting over as context fills.
- Teams using smaller context windows that want to retain older conversation information through summaries and on-demand restoration.
- Developers seeking to reduce repeated input tokens in extended agent sessions, with cache reporting to inspect proxy behavior.
- Operators integrating multiple coding-agent clients through a shared proxy, using the integration method each client supports.

## Our Take

This is an ambitious, actively changing context-management proxy with broad client coverage, but its reported contributor concentration and early project status merit a cautious trial before relying on it for critical workflows.

**Good fit if:**
- You use a supported coding-agent client and need longer sessions than its ordinary context handling allows.
- You can install and operate a Node.js proxy, or prefer the supplied Docker option.
- You are comfortable evaluating a fast-moving project and checking its session and cache reports during use.

**Look elsewhere if:**
- Your workflow depends on a stable, slowly changing integration surface; the project is new and changes rapidly.
- You need a project with clearly established multi-person maintenance, since most contributions currently come from one person.
- You require a clearly asserted license for the code before adoption; the repository metadata reports no license assertion.

## Project Health

| Signal | Value |
|---|---|
| Status | **New**: less than six months old and changing fast |
| Last commit | 2026-10-22 (today) |
| Commits, last 90 days | 100+ |
| Releases, last 12 months | 100+ (latest v0.1.204, 2026-10-21) |
| Contributors | 50 (top contributor: 93% of commits) |
| Issues closed, last 90 days | 45+ (typically closed in 0 days) |
| Pull requests merged, last 90 days | 70 (typically merged in 0 days) |
| Project age | 3 months |

Checked on 2026-10-22 with the GitHub API.

## Project Facts

- Language: TypeScript
- Stars: 2.3k
- Forks: 198
- Topics: dsh-plugin
- Archived: no

## What You Need

Detected in the repository:

- Node.js >=20 (from package.json)
- A Dockerfile, so it can run in a container
- A test suite and automated checks on GitHub Actions

## Getting Started

Install the CLI with npm:

```bash
npm install -g billion-context --prefix=~/.local
```

Then try a client launcher such as `bili claude`, or see the README for native plugin setup, other clients, configuration, and Docker instructions.

## License in Plain Words

No standard license was detected. Without a license, the default copyright rules apply: you may read the code, but not reuse it. Check the repository or ask the authors.

## Alternatives

- [tooltrim](https://osrepos.com/repo/nac7-tooltrim): tooltrim extracts or retrieves relevant parts of large tool results, while billion-context incrementally compresses coding-agent conversations.

| Project | Language | License | Stars | Status |
|---|---|---|---|---|
| **billion-context** | TypeScript | – | 2.3k | New |
| [tooltrim](https://osrepos.com/repo/nac7-tooltrim) | Python | MIT | 3 | New |

## Considerations

- The project is marked **New** and is changing quickly, with very frequent recent commits and releases. Its measured contributor activity is highly concentrated in one person, which may affect continuity and review capacity.
- The package requires Node.js 20 or later. Docker is available, but the README advises using a Node 24 base for its container setup.
- The repository license metadata is `NOASSERTION`. The README specifically identifies the paper as MIT-licensed, but that does not establish the license for the whole codebase; verify the applicable terms before adopting or redistributing the software.
- The proxy can expose an unauthenticated service when configured to listen beyond loopback. The README advises restricting such access to a trusted network.
- The project describes compression as model-driven and incremental. Its stated token savings and session scale are project claims, not independent guarantees for every client, model, or workload.