@symbioticsec/context-mode-plugin
v0.1.0
Published
Symbiotic plugin adapter for context-mode — context window optimization, sandboxed tool output, FTS5 search, and routing enforcement
Readme
@symbioticsec/context-mode-plugin
Symbiotic adapter for context-mode — context window optimization for AI coding agents.
Features
This plugin brings context-mode's capabilities to Symbiotic:
- Tool output sandboxing — archives bash/read/grep/glob output (~98% context reduction)
- Session memory — SQLite-backed event store with resume snapshots across compaction
- Routing enforcement — blocks or redirects wasteful tool calls (curl, wget, raw grep, etc.)
- Native ctx_* tools — in-process search, execute, index, and batch tools (no separate MCP child)
- Native lifecycle hooks — maps tool, prompt, compaction, session-start, and session-stop events directly to Symbiotic
- Compaction continuity — stores snapshots before compaction, then restores bounded session guidance through
session.start - Stable routing context — injects
<context_window_protection>rules through nativesession.start
Install
From your project directory:
symbiotic plugin @symbioticsec/context-mode-pluginOr add manually to .symbiotic/symbiotic.json:
{
"plugin": ["@symbioticsec/context-mode-plugin"]
}Routing rules (AGENTS.md)
Copy AGENTS.md into your project root so the model knows context-mode routing before tools get blocked:
cp path/to/symbiotic-context-mode-plugin/AGENTS.md ./AGENTS.mdHooks still enforce routing without this file; AGENTS.md reduces confusing redirect messages and retries.
Storage
Session events, indexed content, and stats are stored together under Symbiotic's XDG data directory:
${XDG_DATA_HOME:-~/.local/share}/symbiotic/context-mode/Override the parent directory with CONTEXT_MODE_DATA_DIR. Advanced users may
set CONTEXT_MODE_DIR to override the context-mode storage directory directly.
Compatibility
The adapter intentionally pins context-mode because it reuses upstream embedded server internals. Update the pinned version only after the package tests pass.
LCM interop
Symbiotic's built-in LCM plugin has interop.contextMode enabled by default. When both LCM and this plugin are active, LCM's pre-tool routing serves archived tool output on identical repeat calls — matching context-mode's behavior.
Upstream
Based on mksglu/context-mode v1.0.x. The Symbiotic adapter reuses the upstream implementation with Symbiotic-specific config paths.
License
Elastic-2.0 (matching upstream context-mode)
