v1.0.0 — Multi-Platform Support, Session Continuity, FTS5 Dedup
The first major release. Context Mode now runs on 5 platforms, survives context compactions with session continuity, and deduplicates repeated command outputs automatically.
Highlights
Multi-Platform Adapters
- Claude Code — Full support: plugin marketplace, hooks, slash commands, session continuity
- Gemini CLI (Beta) — MCP server + BeforeTool/AfterTool/SessionStart hooks
- VS Code Copilot (Beta) — MCP server + PreToolUse/PostToolUse/SessionStart hooks
- OpenCode (Beta) — MCP server + TypeScript plugin paradigm (
tool.execute.before/after) - Codex CLI (Beta) — MCP server + AGENTS.md routing instructions (no hook support)
Each platform has its own adapter implementing the HookAdapter interface with platform-specific input parsing, response formatting, config paths, diagnostics, and upgrade logic.
Session Continuity
- Every file edit, git operation, task, error, and user decision is tracked in a per-project SQLite database
- When context compacts, a priority-tiered snapshot (≤2 KB) is built and indexed into FTS5
- The model receives a structured Session Guide with 15 categories — continues from your last prompt without re-prompting
- Works across compactions and
--continueresumes - 5 hooks working together: PostToolUse, UserPromptSubmit, PreCompact, SessionStart, and routing via PreToolUse
FTS5 Index Deduplication (#67)
- Re-indexing with the same source label now replaces previous content atomically
- Prevents stale command outputs from accumulating in build-fix-build cycles
- Only the latest output per label is searchable — no more Claude referencing old errors
New Features
ctx_batch_execute— Run multiple commands + search multiple queries in ONE callctx_fetch_and_index— Fetch URL, detect content type (HTML/JSON/text), chunk and index- Background mode for
ctx_execute— persistent processes with network stats tracking - CLI hook dispatcher —
context-mode hook <platform> <event>for global install compatibility - Universal ctx commands via MCP meta-tools —
ctx stats,ctx doctor,ctx upgradework on all platforms - AND-first search semantics with OR fallback cascade (#23)
- Aggressive redirect for gradle/maven build tools to sandbox (#38)
- Sandbox env passthrough for direnv, nix, asdf, mise, venv, conda (#22)
ctx_tool prefix to avoid naming conflicts with other MCP servers- Cross-platform tool name normalization for routing
Bug Fixes
fileURLToPath()for Windows path handling in server.ts and sessionstart.mjs- Remove POSIX
2>/dev/nullredirect in CLI (Windows compat) - VS Code Copilot adapter:
process.cwd()fallback for projectDir - Atomic dedup in store.ts (delete+insert in single transaction)
- Transactional
insertEventin session DB (race condition fix) unhandledRejection+uncaughtExceptionhandlers for MCP server- Windows line ending handling (
\r?\n) in runtime detection - False-positive HTTP regex matching inside quoted arguments
- Batch execute per-command execution with Tier 2 cross-source warnings
- Heredoc-aware routing in PreToolUse hook
- Stream byte cap for large outputs
- Python SSL certificate passthrough in sandbox
Breaking Changes
- Repository renamed:
claude-context-mode→context-mode(GitHub auto-redirects) - Tool names prefixed:
execute→ctx_execute,batch_execute→ctx_batch_execute, etc. - Plugin marketplace:
mksglu/claude-context-mode→mksglu/context-mode
Architecture
- Flat
src/structure with adapter pattern (src/adapters/{platform}/) - Shared
db-base.tsfor SQLite infrastructure (WAL, prepared statements, cleanup) - Session module:
session/db.ts(persistent storage),session/extract.ts(event extractors),session/snapshot.ts(resume builder) - Hook scripts: platform-specific hooks in
hooks/{platform}/, shared core inhooks/core/ - 32 test files, 689 tests, 12.7s full suite
Test Coverage
| Area | Files | Tests |
|---|---|---|
| Adapters | 6 | 131 |
| Hooks | 4 | 84 |
| Session | 4 | 132 |
| Store + Search | 7 | 128 |
| Security | 1 | 75 |
| Executor | 1 | 84 |
| Integration | 3 | 55 |
| Total | 32 | 689 |
Contributors
- @rjkaes — searchWithFallback, stream byte cap, shell expansion fix
- @ekosz — Elixir language support
- @dunika — CLAUDE_PROJECT_DIR relative paths
- @RicoKirstein — FTS5 dedup feature request (#67)
Install
# Claude Code (plugin marketplace)
/plugin marketplace add mksglu/context-mode
/plugin install context-mode@context-mode
# Other platforms (global install)
npm install -g context-modeFull platform setup: README.md