ngotrnghia1811/opencode-headroom

Context compression plugin for opencode — port of headroom v0.24.0 with Kneedle adaptive-K, BM25 relevance scoring, and CCR reversibility

0

stars

27

commits

TypeScript

primary language

Jun 11, 2026

updated

README

@ngotrnghia1811/opencode-headroom

Context compression plugin for opencode — port of headroom v0.24.0.

Reduces token usage 60–95% on large tool outputs, logs, diffs, and search results — without losing information the LLM needs. Original content is cached locally (CCR) for on-demand retrieval.

Quick start

npm install @ngotrnghia1811/opencode-headroom
// opencode.json
{
  "plugin": ["@ngotrnghia1811/opencode-headroom"]
}

Documentation

DocumentDescription
SETUP.mdInstallation, configuration, troubleshooting
DEVELOPMENT-PLAN.mdFull porting plan, architecture, implementation phases
discrepancy.mdDocumented differences from upstream headroom v0.24.0
headroom-learn-todo.mdDesign doc for deferred headroom-learn feature

Tools provided

  • headroom_stats — session compression metrics (tokens saved, compressor hits)
  • headroom_retrieve(hash) — retrieve original content from CCR <<ccr:HASH>> markers

Development

bun install
bun test              # 178 tests
bun run typecheck     # bundle check

License

Apache 2.0

Contributors

nghiatrngo

27 commits

ngotrnghia1811/opencode-headroom

Context compression plugin for opencode — port of headroom v0.24.0 with Kneedle adaptive-K, BM25 relevance scoring, and CCR reversibility

0

stars

27

commits

TypeScript

primary language

Jun 11, 2026

updated

README

@ngotrnghia1811/opencode-headroom

Context compression plugin for opencode — port of headroom v0.24.0.

Reduces token usage 60–95% on large tool outputs, logs, diffs, and search results — without losing information the LLM needs. Original content is cached locally (CCR) for on-demand retrieval.

Quick start

npm install @ngotrnghia1811/opencode-headroom
// opencode.json
{
  "plugin": ["@ngotrnghia1811/opencode-headroom"]
}

Documentation

DocumentDescription
SETUP.mdInstallation, configuration, troubleshooting
DEVELOPMENT-PLAN.mdFull porting plan, architecture, implementation phases
discrepancy.mdDocumented differences from upstream headroom v0.24.0
headroom-learn-todo.mdDesign doc for deferred headroom-learn feature

Tools provided

  • headroom_stats — session compression metrics (tokens saved, compressor hits)
  • headroom_retrieve(hash) — retrieve original content from CCR <<ccr:HASH>> markers

Development

bun install
bun test              # 178 tests
bun run typecheck     # bundle check

License

Apache 2.0

Contributors

nghiatrngo

27 commits

Languages

TypeScript

100.0%