NewRecall: all-day sessions, no compaction

Spend less on coding agents. Control what they do.

Context Mode sits between your coding agents and the model. Each request costs less, sessions carry what they learned, and your rules decide what runs.

npx @context-mode/cli

1,000 requests free, every feature, no card. Works with Claude Code, Codex, OpenCode, Pi and their desktop apps. Set up your app

From the team behind the free Context Mode Engine: 33K GitHub stars

Your coding agentIts model
Claude Code
Claude
Codex
GPT
OpenCode
Claude
Pi
Claude, GPT
Also: Claude Desktop, Codex Desktop and T3 Code
Context Mode
SaveContext Saving
Protect
Remember
Claude Code600 tests, 1 to fix17.0 KB → 1.2 KBfolded
Codexcat .envstopped before the shellblocked
Claude Code2 h laterpicked up, full historyrecalled
Codex7 MB registry file407 B back to the modelin code
Claude Codegit push origin mainprotected branchblocked
Codexdeploy target?Render, not Hetznerremembered
Claude Codeturn this plan into ticketsto-tickets loadedskill
Gateway A/B, long session, Claude Opus 5.5$7.20 → $2.4965.5% lower
How it works

Spend less. Remember more. Run only what you allow.

Context Mode acts at three points on each request: before it goes out, before a tool runs, and when a result comes back.

Your coding agentsAny machine
17.0 KB800 orders330,785 tokens
Context Mode
  • Folds test, build and log output
  • Runs scripts, returns the answer
  • Trims tool schemas
1.2 KB4 orders75,591 tokens
Model APIYour Anthropic or OpenAI account
Your archiveFull output, read back by id
Try it

Your agent runs 600 tests. 1 fails.

Printed17.0 KB
Sent to the model1.2 KB

Sent to the model

  • The failing test and its error
  • The summary line
  • One line for the 599 that passed

Kept in your archive

  • All 600 results, word for word
npm test fix loop · Claude Opus 5.5$0.087 → $0.06822% lower15 of 16 runs

Your agent reads an API response with 800 orders.

Printed800 orders
Sent to the model4 orders

Sent to the model

  • Every field name
  • The first 3 orders and the last
  • A line that counts the rest

Kept in your archive

  • The other 796 orders
One large JSON file · Claude Opus 5.5$0.086 → $0.06821% lower12 of 12 runs

One session, 30 steps. Tokens sent on each call.

Direct330,785
Context Mode75,591

Sent to the model

  • Your recent work, unchanged
  • An index of older work

Kept in your archive

  • Older work, word for word
Long agentic coding session · Claude Opus 5.5$7.20 → $2.4965.5% lower4 of 4 runs

Save

Tool output is folded before the model reads it. The full output is archived.

Features Context Saving → Thinking in Code → Active Context → Prompt caching → How saving works →
Your coding agentsAny agent, any machine
your prompt
Context Mode
  • Adds the facts that matter
  • Loads the skill the task needs
  • Keeps the whole session
+ context
Model APIYour Anthropic or OpenAI account
MemoryFacts with two clocks
SkillsFrom any GitHub repo
ArchiveEvery word, searchable
Try it
FactValueValid fromUntil
production deployed_toHetzner Cloud, Falkenstein21:14:3821:15:09
production deployed_toRender, Oregon region21:15:09now

The old value closes. Every agent gets the new one.

Your agent sendssystem prompttoolsthe full history
The model getssystem prompttoolsmemory blockindex of older workrecent work, unchanged

Older work goes to the archive, word for word.

⚡ context-mode · picked up after a 2 h pause, full history kept
Your skillsrelease-notesto-ticketsdb-migrations
⏺ context-mode · skill to-tickets auto-loaded

Matched on name and description. One skill per turn.

Remember

Sessions don’t compact. Facts and skills carry across agents and machines.

Features Recall → Memory → Skills → Search → Session resume →
Modelasks for a tool call
tool call
Protect
  • Reads the call by what it does
  • Checks your rules
  • Logs every block
decision
AllowedrunsYour terminal runs it
Blockednever runsThe model reads why
Pick a command
Blocked · stopped before your shellRead environment files

.env and .env.*. Examples and templates are allowed.

⛔ context-mode Cage blocked this command, so it was NOT executed:
Blocked by your team’s policy: Read environment files. .env files hold secrets.
Blocked · stopped before your shellPush to protected branches

main, master, production and release/*.

⛔ context-mode Cage blocked this command, so it was NOT executed:
Blocked by your team’s policy: Push to protected branches. Protected branches change through reviewed pull requests.
Blocked · stopped before your shellCore protection: delete the root or home folder

Read through sudo, sh -c and about 130 other wrappers.

Blocked · stopped before your shellSites: pastebin.com

The inner host is checked too.

RunsNo rule matches

A project folder is fine. Only losses you can't undo are blocked.

RunsNo rule matches

Nothing is blocked until you choose rules.

Protect

Rules for what agents may run, read and fetch. Nothing is blocked until you choose them.

Features Protect → Rules and presets → Instructions →
Get started free1,000 requests free, no card.
Benchmarks

Same task, run twice. Measured in dollars.

Claude Code on Opus 5.5. Each task ran direct to Anthropic and through Context Mode, back to back. Cost at API list price.

DirectThrough Context ModeCost per task

Every pair counts. No figure for Codex yet. Method, 95% ranges and Haiku 4.5 →

Get started free1,000 requests free, no card.

Headless CI

Cheaper coding agents in CI. 20% to 23% lower cost per run.

Add two env lines to the job that runs your agent. Same agent, same prompt, same model. Pick a job, set your runs, see the saving.

CI job
Model

22.8% lower cost per run

A test fails on a pull request. The agent reads the logs, finds the cause and pushes a fix.

Direct per month$50.20
Context Mode per month$42.00
You save per month$8.20

Sonnet 5.5 · 16 tasks · 95% range 11.6 to 32.2% · proof
Each month is the runs you set times the measured cost per run.

Next step

npx @context-mode/cli ci init

Try it with your keyRun it in your own repoSee the proof


Get started

Set up in a minute. Removed with one command.

Works with Claude Code, Claude Desktop, Codex, Codex Desktop, T3 Code, OpenCode and Pi. Install your app the way its makers say. Then one command signs you in, finds it, and shows each change before it writes. Your own model account still pays the model.

  1. Install your app

    Use its makers’ own install. Pick your app to see how its makers install it.

  2. Run the CLI

    It signs you in, asks which apps to connect, and keeps a backup of each file.

    npx @context-mode/cli
  3. Restart and watch

    Start a new session. Work as before. The console shows tokens, cost and saving for every request. Open the console →

Your app

1 Install Claude Code from its makers: Claude Code setup →

2 Connect Context Mode

npx @context-mode/cli setup --agent claude

Writes ~/.claude/settings.json

You need Your Claude login, a subscription or an API key. Restart Claude Code.

1 Install Claude Desktop from its makers: Download Claude →

2 Connect Context Mode

npx @context-mode/cli setup --agent claude-desktop

Writes Developer → Configure Third-Party Inference… (an entry named contextmode)

You need Quit the app fully (Cmd+Q) and open it again. The Code and Cowork tabs go through Context Mode.

1 Install Codex from its makers: Codex CLI →

2 Connect Context Mode

npx @context-mode/cli setup --agent codex

Writes ~/.codex/config.toml

You need Your Codex login: ChatGPT, or an API key stored with codex login --with-api-key. A key that is only exported in your shell is not sent.

1 Install Codex Desktop from its makers: ChatGPT desktop app for macOS and Linux →

winget install --id 9PLM9XGG6VKS -s msstoreWindows

2 Connect Context Mode

npx @context-mode/cli setup --agent codex-desktop

Writes ~/.codex/config.toml (the same file as the Codex CLI)

You need Your Codex login. Quit the app fully (Cmd+Q) and open it again.

1 Install T3 Code from its makers: T3 Code install docs →

brew install --cask t3-codedesktop app, macOS
curl -fsSL https://t3.codes/install.sh | shCLI, macOS and Linux
winget install T3Tools.T3CodeWindows

2 Connect Context Mode

npx @context-mode/cli setup --agent t3code

Writes ~/.claude/settings.json and ~/.codex/config.toml

You need T3 Code runs the Claude Code and Codex you have, with their logins. In Settings → Providers, keep CODEX_HOME at ~/.codex and leave Shadow home empty.

1 Install OpenCode from its makers: OpenCode docs →

curl -fsSL https://opencode.ai/install | bash
npm install -g opencode-ai
brew install anomalyco/tap/opencode

2 Store your API key with OpenCode’s own login

opencode auth loginpick Anthropic, or set ANTHROPIC_API_KEY

3 Connect Context Mode

npx @context-mode/cli setup --agent opencode

Writes ~/.config/opencode/opencode.json

You need Your own Anthropic API key. OpenCode has no Claude sign-in, so a Claude subscription does not work here. No key is written to the file.

1 Install Pi from its makers: Pi on GitHub →

npm install -g @earendil-works/pi-coding-agent
curl -fsSL https://pi.dev/install.sh | sh

2 Store your API key

Start pi, then type /login in Pi, not in your shell. Or set ANTHROPIC_API_KEY or OPENAI_API_KEY.

3 Connect Context Mode

npx @context-mode/cli setup --agent pi

Writes ~/.pi/agent/models.json

You need Your own Anthropic or OpenAI API key. A Claude subscription does not go through Pi. If you use one, setup sets only OpenAI.

To leave: npx @context-mode/cli disconnectQuick start →
Get started free1,000 requests free, no card.
Protect

Your agent asks. Your rules answer.

Protect checks every command, file read, web fetch and tool-server call from Claude Code and Codex before it runs. The hook stops a blocked call before your shell. In every plan, Free included. How Protect works →

  1. 01Connect your agents
    npx @context-mode/cli

    Only the base URL changes.

  2. 02Pick a preset

    Nothing is blocked until you pick one.

  3. 03Keep working

    The agent reads why a call was blocked. You see it in the log.

Preset

See before you rule.7 run

git push origin mainRuns
cat .envRuns
rm -rf ~Runs
terraform destroyRuns
aws s3 rm s3://backups --recursiveRuns
WebFetch example.comRuns
npm testRuns

Nothing is blocked. Activity lists the programs, sites and tool servers your agents used, each with Block and Allow.

Where most developers start.4 blocked · 1 logged · 2 run

git push origin mainBlockedPush to protected branches
cat .envBlockedRead environment files
rm -rf ~BlockedCore protections
terraform destroyBlockedDestroy infrastructure
aws s3 rm s3://backups --recursiveLoggedChange cloud resources
WebFetch example.comRunsOther sites allowed
npm testRuns

The hook stops a blocked call before your shell: the agent reads the rule and why, and carries on. Logged means it ran, and the log says it would have been blocked.

For regulated teams and unattended agents.6 blocked · 1 run

git push origin mainBlockedPush to protected branches
cat .envBlockedRead environment files
rm -rf ~BlockedCore protections
terraform destroyBlockedDestroy infrastructure
aws s3 rm s3://backups --recursiveBlockedChange cloud resources
WebFetch example.comBlockedOnly sites on your list
npm testRuns

Only the sites and tool servers on your list are reached. Public package registries stay open.

Or write your own rules for sites, commands, scripts, files and tool servers, and test each one before you save it. Rule types →

For you Free · Pro, from $20 a month

  • One policy for Claude Code and Codex, on every machine you sign in from
  • Presets, four packs and your own rules
  • A log of every decision, export as CSV or JSON Lines
  • Core protections stay on when your requests run out
Get started free

For your team Team · Enterprise

  • One policy for the whole org. An agent cannot loosen it
  • An API key can only tighten it. Loosening needs a person and a reason
  • Every change in History, in a hash chain you can verify
  • One pool of requests and one bill. Enterprise can run in your own Cloudflare account
Talk to us

Tested in real Claude Code sessions with Claude Opus 5.5 (2026-10-02) and Claude Haiku 4.5 (2026-10-04): every run blocked the push to main and the read of .env, and the work still shipped on a branch. Try it in 5 minutes →
Protect reads the call, not the program: a script file or a compiled program gets past it. Keep your agent’s sandbox on.

Open source

Context Mode Engine. Free, local, private.

Context Mode Engine runs on your machine with ten coding agents. It keeps raw tool output in a local sandbox and index, so only the answer enters the context. The source is on GitHub, open to read.

Free for all time
Free to use. Source-available under the Elastic License 2.0.
Local
It runs on your machine and keeps its data in ~/.context-mode.
Private
Your code and sessions stay on your machine.
98.8% fewer bytes in context
Median over tool outputs of 10 KB or more, benchmark of 2026-10-31. How we measure

33K GitHub stars and 718K npm downloads. Daily stats · Method and sources

Pick your agent to see its own install command.

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

Try it on your own agents.

Start free: 1,000 requests, every feature, no card. When you run out, nothing breaks.

Get started free

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

Start free: 1,000 requests, every feature, no card. After you sign in, the console gives you one command to connect your coding agent.

Read the docs