Install

Install Context Mode Engine in your agent

Context Mode Engine is a free plugin for your coding agent. Install it with the agent's own install command, restart the agent, then run one check. Every command on this page comes from the plugin's own install guide.

Free · Local · Private · Forever

Context Mode Engine is source-available under the Elastic License 2.0. Free to use, for all time. It runs on your machine and keeps your data in ~/.context-mode.

Key facts

What it is
The install steps for Context Mode Engine: your agent's own install command, a restart, then one check.
Who it is for
Anyone who uses a coding agent in a terminal or an editor and wants the Engine in it.
Agents
Claude Code, Codex, Gemini CLI, Qwen Code, Pi, OpenCode, Copilot CLI, Kiro, VS Code and ZCode.
Measured result
Each hook adds 7.3 ms to 14.6 ms per tool call, by agent, in the 2026-10-31 benchmark.
Scope
Needs Node 24.15.0 or later. On Windows, it also needs Git for Windows.

Every agent installs in its own way

Claude Code uses a plugin marketplace. Gemini CLI uses extensions. Pi installs from npm. When each tool asks for a different config file, setup takes longer than the work.

Context Mode Engine uses the command your agent already knows. You type what you type for any other plugin in that agent. The Engine then brings its tools, hooks and skills with it.

Before you start

Check your Node version first. The Engine needs Node 24.15.0 or later, because it uses the built-in node:sqlite:

node -v

Step 1: pick your agent and run its command

Pick your agent below. Each tab shows that agent's own install command first, then the next step and the check. The agents fall in three groups: agents with a plugin store, agents that load the Engine as a plugin inside the agent (Pi and OpenCode load it as a plugin in their own process, and the plugin brings the tools), and agents that install from npm, then run setup.

Claude Code

Plugin. Context Mode installs with the agent's own plugin command.

Install

claude plugin marketplace add mksglu/context-mode
claude plugin install context-mode@context-mode

Check

/ctx-doctor
Update and remove

Update

claude plugin update context-mode@context-mode

Remove

context-mode setup --remove --agents claude-code

The hook check passed on 2026-10-26 with Claude Code 2.1.309. Source: the install guide

Codex

Plugin. Context Mode installs with the agent's own plugin command.

Install

codex plugin marketplace add mksglu/context-mode
codex plugin add context-mode@context-mode

Next, trust the hooks

npm i -g context-mode
context-mode setup --agents codex

Check

/ctx-doctor
Update and remove

Update

codex plugin marketplace upgrade context-mode

Remove

context-mode setup --remove --agents codex

The hook check passed on 2026-10-26 with Codex 0.164.0. Source: the install guide

Gemini CLI

Plugin. Context Mode installs with the agent's own plugin command.

Install

gemini extensions install https://github.com/mksglu/context-mode

Check

/ctx-doctor
Update and remove

Update

gemini extensions update context-mode

Remove

context-mode setup --remove --agents gemini
gemini extensions uninstall context-mode

The hook check passed on 2026-10-26 with Gemini CLI 0.65.0. Source: the install guide

Qwen Code

Plugin. Context Mode installs with the agent's own plugin command.

Install

qwen extensions install https://github.com/mksglu/context-mode:context-mode

Check

/ctx-doctor
Update and remove

Update

qwen extensions update context-mode

Remove

context-mode setup --remove --agents qwen
qwen extensions uninstall context-mode

The hook check passed on 2026-10-26 with Qwen Code 0.26.1. Source: the install guide

Pi

Plugin inside the agent. The agent loads Context Mode as a plugin in its own process. Its tools come from that plugin.

Install

pi install npm:context-mode

Check

pi list
Update and remove

Update

pi update --extensions

Remove

pi remove npm:context-mode

The hook check passed on 2026-10-26 with Pi 0.73.1. Source: the install guide

OpenCode

Plugin inside the agent. The agent loads Context Mode as a plugin in its own process. Its tools come from that plugin.

Install

opencode plugin add context-mode
opencode plugin context-mode --global

Check

/ctx-doctor
Update and remove

Update

opencode plugin update

Remove

opencode plugin remove context-mode
context-mode setup --remove --agents opencode

The hook check passed on 2026-10-26. Install and hooks are checked. The plugin's tool name gets its check in a live OpenCode session next. Source: the install guide

Copilot CLI

npm and setup. Install Context Mode with npm. Then setup adds its hooks to the agent.

Install

npm i -g context-mode
context-mode setup --agents copilot-cli

Check

/ctx-doctor
Update and remove

Update

context-mode upgrade

Remove

context-mode setup --remove --agents copilot-cli

The hook check passed on 2026-10-26 with Copilot CLI 1.0.103. Source: the install guide

Kiro

npm and setup. Install Context Mode with npm. Then setup adds its hooks to the agent.

Install

npm i -g context-mode
context-mode setup --agents kiro

Check

/ctx-doctor
Update and remove

Update

context-mode upgrade

Remove

context-mode setup --remove --agents kiro

Checked at hook setup on 2026-10-26. A live run in the host app comes next. Source: the install guide

VS Code

npm and setup. Install Context Mode with npm. Then setup adds its hooks to the agent.

Install

npm i -g context-mode
context-mode setup --agents vscode

Check

/ctx-doctor
Update and remove

Update

context-mode upgrade

Remove

context-mode setup --remove --agents vscode

Checked at hook setup on 2026-10-26. A live run in the host app comes next. Source: the install guide

ZCode

npm and setup. Install Context Mode with npm. Then setup adds its hooks to the agent.

Install

npm i -g context-mode
context-mode setup --agents zcode

Check

/ctx-doctor
Update and remove

Update

context-mode upgrade

Remove

context-mode setup --remove --agents zcode

The hook check passed on 2026-10-26. Source: the install guide

Source for every command and status line: the plugin's install guide.

Codex: trust the hooks

Codex runs a hook after you trust it. The context-mode command from npm marks the hooks trusted. Install it, then run setup once:

npm i -g context-mode
context-mode setup --agents codex

Already installed from GitHub?

Did you add the plugin straight from GitHub before 2.0 was on main? Add it again from main. Find your agent below.

Claude Code

Did you add mksglu/context-mode before 2.0 was on main? claude plugin marketplace remove removes a configured marketplace and its plugins. Then add the marketplace again from main:

claude plugin marketplace remove context-mode
claude plugin marketplace add mksglu/context-mode
claude plugin install context-mode@context-mode

claude plugin list must show 2.0.0 or later.

Codex

Did you add mksglu/context-mode before 2.0 was on main? codex plugin remove uninstalls a plugin and removes its local cache; codex plugin marketplace remove removes a configured marketplace source by name. Then add it again from main:

codex plugin remove context-mode@context-mode
codex plugin marketplace remove context-mode
codex plugin marketplace add mksglu/context-mode
codex plugin add context-mode@context-mode

codex plugin list must show 2.0.0 or later.

Gemini CLI

Did you install before 2.0 was on main? gemini extensions uninstall uninstalls one or more extensions. Then install again from main:

gemini extensions uninstall context-mode
gemini extensions install https://github.com/mksglu/context-mode

gemini extensions list must show 2.0.0 or later.

Qwen Code

Did you install before 2.0 was on main? qwen extensions uninstall uninstalls an extension. Then install again from main:

qwen extensions uninstall context-mode
qwen extensions install https://github.com/mksglu/context-mode:context-mode

qwen extensions list must show 2.0.0 or later.

Step 2: restart the agent

Close your agent and open it again. The agent loads the Engine's tools, hooks and skills when it starts. Restart it again after each update.

Step 3: check the install

Inside the agent, run the doctor skill:

/ctx-doctor

Doctor checks Node, the tools, the hooks and the skills for each agent. Each check shows PASS when it is ready. If a check asks for a fix, doctor prints the command to run.

Pi has its own check. It lists the Engine package when the install worked:

pi list

What you get

Your agent now sends large tool output to a local sandbox and index, and reads a short reply. The hooks stay light. In the 2026-10-31 run, a hook added 7.3 ms to 14.6 ms per tool call, by agent. That is the median of 5 hook runs, minus the median of 5 bare node starts (raw results).

Next, run your first session and see the bytes the Engine keeps out of your context.

Context Mode Gateway is optional and hosted. The Engine works on its own. How the two fit

Prompts to give your agent

Paste one into your agent. Each prompt shows in full.

Prompt
Install Context Mode Engine for this agent. Use the agent's own install command from https://github.com/mksglu/context-mode/blob/16a4bcc5170528db5bcf9924ceaac05e28db8588/docs/install/README.md, then run `context-mode doctor` and show me the result.
Prompt
Run `context-mode doctor` and tell me which checks show PASS. For each other check, run the command it prints.

Get started free

Context Mode Gateway: your coding agent costs less and remembers your project. Context Mode Engine installs from your terminal.

After you sign in, the console gives you one command to connect your coding agent.

Read the docs