Context curation before LLM requests — layered cacheable prefixes, token compaction, intelligent file selection.
opencode sends your entire project context to the LLM — wasting tokens on irrelevant files. Context Curator pre-filters files before each request: only changed blocks + surrounding context, prioritized by relevance. Dirac-inspired architecture saves significant tokens per session.
opencode plugin @four-bytes/four-opencode-context-curator -gRestart opencode.
4-layer cacheable prefix system with stability TTLs:
| Layer | Content | Stability |
|---|---|---|
| Core Prefix | Project structure, conventions | High (TTL: session) |
| Repo Profile | Git history, recent changes | Medium (TTL: 5 min) |
| Task Slice | Current task context | Low (TTL: per-request) |
| Issue Slice | Related issue context | Low (TTL: per-request) |
Compaction module reduces context when approaching token budget limits.
No config file required — works out of the box. Token budget defaults to 8000 tokens. Behavior adjustable via opencode configuration.
PRs welcome! See CONTRIBUTING.md.
bun install
bun run build
bun testApache-2.0 — see LICENSE
If this plugin saves you tokens, consider leaving a ⭐ on GitHub.