Installation
Install context-mode on any of its 17 supported agent CLIs — most hosts need a single command.
The ctx_* tools and the context-protection engine are identical on every host.
What differs is how a host wires context-mode in — and whether you need a global
package at all. Pick your host below, or use the generic MCP guide for anything
not yet officially supported.
Which install do I need?
Plugin install — no global package
Claude Code and Codex CLI bundle the server, hooks, and slash commands from one marketplace command.
Plugin install — clone + link
Cursor's Marketplace listing is in review, so install the plugin from a local checkout today.
Package + config
Gemini CLI, VS Code / JetBrains Copilot, Qwen Code, Kimi Code, OpenCode, KiloCode. Install the npm package, then add the host config.
- No global install. A marketplace command bundles the server, hooks, and
slash commands: Claude Code (
/plugin install context-mode@context-mode) and Codex CLI. - Plugin from a local checkout. Cursor's Marketplace plugin is still awaiting
Cursor team review, so today you clone the repo and symlink (macOS/Linux) or
robocopy(Windows) it into~/.cursor/plugins/local/context-mode. The plugin's hook commands runnpx -y context-mode, so no global package is required. - Plugin + global binary. Copilot CLI installs as a plugin
(
copilot plugin install mksglu/context-mode:configs/copilot-cli), but its MCP server and hooks run the globalcontext-modebinary, sonpm install -g context-modeis a prerequisite. Antigravity CLI (agy) works the same way —npm install -g context-mode, thenagy plugin install https://github.com/mksglu/context-mode/tree/main/configs/antigravity-cli. - Package + config. Hosts without a marketplace install the package, then add
a config entry: Gemini CLI, VS Code Copilot, JetBrains Copilot, Qwen Code,
Kimi Code, OpenCode, KiloCode, and Kiro (which adds native
preToolUse/postToolUsehooks). - Dedicated installer. OpenClaw ships a native gateway plugin you install with
npm run install:openclaw. - MCP-only. Register an MCP server (run it through
npx -y context-modefor no global install) plus a routing file: Antigravity, Zed, OMP.
Package, installer, and npx-based hosts need Node.js 22.5+ or
Bun (auto-detected and faster). Pure plugin hosts handle
their own runtime.
How integration differs
A host connects through one of three paradigms, and the paradigm decides which context-protection features are available.
- JSON stdin/stdout hooks — the richest model: context-mode can rewrite tool
arguments, inject sandbox output, and block a call before it runs. Used by
Claude Code, Codex CLI, Copilot CLI, Cursor, Gemini CLI, VS Code / JetBrains
Copilot, Qwen Code, Kimi Code, Kiro, and Antigravity CLI (
agy, with bounded hooks). - Native plugins / extensions — context-mode loads in-process and registers
real hooks. Used by OpenCode, KiloCode, OpenClaw, and Pi (a package extension
via
pi.on(...)). - MCP-only with a routing file — the host speaks MCP but exposes no hook surface, so a routing instruction file steers the model toward the sandbox (advisory, ~60% adherence). Used by Antigravity, Zed, and OMP.
Capability matrix
| Host | Session continuity | Tool-arg modification | Tool-output injection | PreToolUse blocking | MCP tools |
|---|---|---|---|---|---|
| Claude Code | yes | yes | yes | yes | yes |
| Cursor | yes | yes | yes | yes | yes |
| Gemini CLI | yes | yes | yes | yes | yes |
| Codex CLI | yes | yes | yes | deny-only | yes |
| OpenCode | yes | yes | yes | yes (plugin) | yes |
| MCP-only hosts | partial (file-driven) | no | no | no | yes (routing file, ~60% adherence) |
Codex CLI supports PreToolUse blocking in deny-only form. MCP-only hosts have no hook surface, so the routing file carries the guidance instead.
Choose your platform
JSON hook hosts
Claude Code
Primary host. Marketplace install, full hook surface, slash commands.
Codex CLI
Marketplace install; deny-only blocking, feature-flag gated hooks.
Copilot CLI
GitHub Copilot CLI. One-command plugin install (needs the global binary).
Cursor
Local-folder plugin today (Marketplace listing in review); native Cursor hooks.
Gemini CLI
Package + auto-detected MCP and hooks.
VS Code Copilot
Package + MCP and hooks inside VS Code.
JetBrains Copilot
Package + MCP and hooks inside JetBrains IDEs.
Qwen Code
Package + hooks; identical wire protocol to Claude Code.
Kimi Code
Package + TOML hooks and MCP.
Kiro
Package + MCP and native preToolUse/postToolUse hooks.
Antigravity CLI
agy plugin install + global binary; bounded hooks.
Native plugin hosts
OpenCode
Native TypeScript plugin integration.
KiloCode
OpenCode-compatible fork; shares the plugin adapter.
OpenClaw
Native gateway plugin via a dedicated installer.
Pi
Pi Coding Agent. Package extension with real hooks plus an MCP server.
MCP-only hosts
Antigravity
Antigravity IDE. MCP server + GEMINI.md routing file.
Zed
MCP server + AGENTS.md routing file.
OMP (Oh My Pi)
MCP server with isolated storage.
Not listed?
Verify any install
context-mode doctorThis checks language runtimes, the knowledge base, and hook registration. In
Claude Code and Cursor you can also run /context-mode:ctx-doctor, or type
ctx doctor to your agent in chat.