Context Limit
Sets a per-model working context budget by lowering the model window, so compaction fires before quality drops.
Quick Answer & Overview
Context Limit is an open-source (MIT) OpenCode V2 plugin by @JadMadi. It resolves: A model's advertised window is larger than its useful working window, and one global compaction threshold is either too late for small models or too eager for large ones.. Installed via opencode plugin add github:jadmadi/opencode-context-limit, it operates locally with 0% telemetry.
opencode plugin add github:jadmadi/opencode-context-limit Local manual setup:
Copy context-limit.ts into ~/.config/opencode/plugins/ and restart the TUI.
The Problem It Solves
A model's advertised window is larger than its useful working window, and one global compaction threshold is either too late for small models or too eager for large ones.
Slash Commands
| Command | Description & Usage |
|---|---|
/context-limit | Show or set a working context budget for a model or pattern. |
Design Guardrails & Limitations
It can only lower a model window, never raise it.
Technical Specifications
- Target Host
- OpenCode V2 (CLI & TUI)
- Tested Runtime
- OpenCode
v2.0.16(builtUnder-2.0.16) - Artifact File
context-limit.ts- Version Scheme
- CalVer (YYYY.MM.MICRO) · Current:
v2026.9.0 - Default Install Path
~/.config/opencode/plugins/context-limit.ts- License
- MIT (Open Source)
- Last Updated
- 2026-09-25
Frequently Asked Questions
What problem does Context Limit solve?
A model's advertised window is larger than its useful working window, and one global compaction threshold is either too late for small models or too eager for large ones.
How do I install Context Limit in OpenCode V2?
Run the terminal command: `opencode plugin add github:jadmadi/opencode-context-limit`. The runtime clones the repository into `~/.config/opencode/plugins/context-limit.ts` and activates it in your next session. Alternatively: Copy context-limit.ts into ~/.config/opencode/plugins/ and restart the TUI.
What are the guardrails and limitations for Context Limit?
It can only lower a model window, never raise it.
What slash commands does Context Limit provide?
/context-limit (Show or set a working context budget for a model or pattern.)