billion-context: ultra-long context setup and cost
billion-context is not a bigger context window; it is a compression proxy between the agent and the model API. It rewrites consumed dialogue into layered summaries so a session runs longer, at the cost of compression calls and some information loss.
A proxy, not a window
The model window is a hard limit; a plugin cannot change it. billion-context compresses history before the request reaches the model, reducing carried tokens (source).
It targets long-session degradation. When the context fills, sessions either truncate or lose the main thread after compaction; a proxy makes compression controlled and partially reversible.
The word proxy matters. Every request passes through it, which also means an extra processing layer and an extra call.
Three mechanisms: layers, increment, restore
Three mechanisms define its capability boundary.
| Mechanism | What it does | Cost |
|---|---|---|
| Layered summaries | Keep the main thread, compress detail | Detail may be lost |
| Incremental writes | Compress only new content | Deeper summary structure |
| On-demand decompression | Restore detail when needed | Extra call and latency |
Layered summaries keep the thread. Older content is compressed harder, recent content keeps more detail; good for long work, poor for verbatim recall.
Incremental writes avoid recompressing everything. Only new content is processed, but summary depth grows, so retrieval crosses more layers.
Decompression is the remedy. Detail lost in summaries can be restored, but not automatically; the model or you must trigger it.
When to use the four tools
The plugin injects four context management tools.
- compress: force compression, useful at a task boundary.
- decompress: restore detail when a summary missed something important.
- search_context: search summaries and compressed content for earlier decisions.
- acp_status: inspect proxy state when compression did not happen or output changed.
Normal use does not require manual calls. The model decides timing and content; manual tools are for diagnosis and correction.
Check status before searching. Status tells you whether compression ran and at which layer; search tells you whether detail remains.
The cost equation
Two entries, not just "saved tokens."
Savings: later requests carry less history, lowering input tokens; long sessions accumulate the benefit.
Spending: compression calls the model to generate summaries; decompression and search may also call.
Net effect depends on session length. Short sessions do not recover compression cost; long sessions clearly save. Enabling it for every short task can be more expensive.
Prefix caching is the third variable. Compression rewrites the request prefix, which may invalidate the cache; lower cache hit rates can raise actual cost above expectations (source).
Enable by scenario. Long projects and multi-day sessions benefit; one-off Q&A and short tasks should leave it off.
Fit and poor fit
It fits long, not exact.
| Scenario | Fit | Reason |
|---|---|---|
| Multi-day project session | Yes | Thread matters, detail can be restored |
| One-off Q&A | No | Compression cost does not pay back |
| Verbatim review | No | Summaries lose detail |
| Multi-turn debugging | Depends | Recent detail stays, old logs compress |
Do not rely on summaries for verbatim accuracy. Contracts, regulations, and line-by-line code review need originals; use search or decompression when exact text matters.
Do not enable for short sessions. Compression is an investment that pays back only over length.
Configure and verify
Three steps: install, configure, verify.
- Install billion-context from the Hub or CLI and restart so it registers.
- Confirm the proxy is enabled and choose a compression strategy for the task.
- Open a long session and watch for compression records.
- Use acp_status to confirm layer count and the last compression time.
- Use search_context to retrieve an early conclusion.
The core verification is "thread intact, detail retrievable." A successful compression is not enough; the model must still answer questions about early agreements.
Test in a throwaway session first. Enabling it in production makes it hard to tell whether compression or the task caused a problem.
Risks: lost detail and invalidated cache
Two risks to know before enabling.
- Summaries lose detail. Lossy compression is unavoidable; write important conclusions explicitly or store them separately.
- Cache invalidation. Rewriting the prefix lowers cache hits and raises cost; watch actual spend in long sessions.
- Deep layers. Long incremental compression deepens the structure and slows retrieval; do a full reorganization periodically.
- Harder diagnosis. An extra proxy layer means a problem may be compression, not the model; check acp_status first.
Risks are not a reason to avoid it; they are a reason to plan. Save key conclusions, monitor cost, and check status first when debugging.
Next steps
Judge session length before enabling. For the built-in compaction mechanism, read What context compaction is. For compaction failures, read What to do when compaction fails. For context overhead, read Plugin context overhead.
Sources: billion-context plugin page, DeepSeek Harness docs, DeepSeek Harness docs - Context and compaction
FAQ
billion-context does not make the context window bigger than the model limit: it sits between the agent and the model API and compresses consumed conversation into layered summaries. The model window remains a hard cap.
billion-context can increase or decrease cost. Compression adds a model call, while summaries reduce the history carried by later requests; long sessions usually net save, short sessions may cost more.
In billion-context, compress forces compression, decompress restores detail, search_context retrieves from summaries, and acp_status shows proxy state. Normally the model decides; use the tools for diagnosis.
After compression the model forgets details because summaries are lossy. Important conclusions should be written explicitly and kept in summaries; restore originals with decompress or search.
Related Terms
- billion-context
- billion-context is a context compression proxy for DeepSeek Harness that sits between the agent and the model API and rewrites consumed dialogue into layered summaries.— billion-context plugin page
- layered summary
- A layered summary compresses dialogue into multiple levels by time or topic; older content sits at higher, less detailed layers.— billion-context plugin page
- on-demand decompression
- On-demand decompression restores part of compressed content when detail is needed, avoiding information loss from summaries.— billion-context plugin page
- prefix cache
- A prefix cache lets a model service reuse computation for identical request prefixes; rewriting the prefix can invalidate it and raise cost.— billion-context plugin page
Sources
- billion-context plugin page· dsh-plugin.org
- DeepSeek Harness docs· deepseek-harness
- DeepSeek Harness docs - Context and compaction· deepseek-harness