Gatewarden Nexus
Docs
Plugins
What's new
Roadmap
Tools
Your Nexus

OpenCode Plugin

nexus-headroom-intercept

v0.1.0Published

Pre-injection context compression for Nexus MCP tool outputs via the tool.execute.after hook.

Overview

Intercepts large Nexus MCP tool responses before they enter the agent context window. Uses policy-based deterministic compression (no LLM summarization) to reduce token consumption while preserving retrieval semantics. Supports three compression profiles: reference-data, structured-list, and search-results. Originals are stored in-memory and on disk for retrieval via headroom_retrieve. The plugin checks the Nexus backend at startup and only activates transform mode when headroom is enabled for the project.

Registered Hooks

tool.execute.after

Intercepts all tool outputs after execution. Applies policy-based compression for Nexus MCP tools that exceed configured token thresholds.

event (session.idle)

Logs compression metrics summary to the project activity log.

Details

DistributionTypeScript source via nexus pull into .opencode/plugins/, no npm install required.
Dependency@opencode-ai/plugin (auto-installed via .opencode/package.json).
RuntimeDistributed as an OpenCode plugin to OpenCode projects; Claude Code projects receive the equivalent Claude Code hook adapter.
ArchitectureUses tool.execute.after hook for pre-injection compression. Deterministic profiles, no LLM calls. In-memory + disk cache for original storage. Fail-open on errors.

Plugin Info

Version
v0.1.0
Hooks
2
Custom Tools
0

Source Code

View the full source, report issues, or contribute on GitHub.

View repository
All pluginsBack to toolsView on GitHub

Get started

Ready to put specifications first?
Start building with Nexus.

Governed specs drive your agents. No ad-hoc prompts, no vibe coding.

Sign in with GitHub
Gatewarden Nexus

Platform

  • Documentation
  • Tools
  • What's new
  • Roadmap
  • Pricing

Resources

  • MCP Server
  • CLI
  • GitHub

Company

  • RelicFrog
  • Imprint

Legal

  • Privacy policy
  • Terms of service
© 2026 RelicFrog Holding UG (haftungsbeschränkt)·v0.17.2 (aea217e)
a Gatewarden product by RelicFrog Holding UG