Contexere CLI

A Rust program that shrinks the command output an agent reads: drops build and test noise, folds repeated file reads and redacts credentials

  • 377 ★ on the repository
  • Last commit
  • Apache-2.0
CLI

Broad access

Why this level

  • Writes hooks into agent settings and intercepts the output of every command, including text that may carry passwords and tokens
  • Rewrites what the model reads and may hide part of the output from it, although what was cut can be restored
  • The curl-to-shell install runs downloaded code on your machine
All reasons and checks

fajarhide/contexere

Install

Manual install

brew install fajarhide/tap/contexere && contexere init

Works on macOS and Linux. contexere init prompts you to pick agents.

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • Writes hooks into agent settings and intercepts the output of every command, including text that may carry passwords and tokens
  • Rewrites what the model reads and may hide part of the output from it, although what was cut can be restored
  • The curl-to-shell install runs downloaded code on your machine

This is third-party code. Review the repository files before installing.

What it does

Contexere is a layer between an agent and the output of its commands. An agent reads everything a command prints: progress bars, Docker layer hashes, a file it opened ten minutes ago. Every byte is billed and takes room in the context. Contexere removes the excess before the model reads it, while what it cut stays on your machine and returns with one command. The program applies a few rules. A repeated file read becomes one line with a handle, and in the README example 7.6 KB shrink to 214 bytes on the second read. A noisy build or test is reduced to the result and the failures. A token or password in rewritten output is replaced with [REDACTED]. A failed command passes through as printed so the agent sees the real error. JSON, YAML and CSV stay byte for byte. After contexere init the hooks work on their own and there is nothing to prefix to commands. Claude Code, Codex CLI, Gemini CLI, OpenClaw, Hermes, Pi and Aider get full rewriting before the model reads the output. Cursor and Windsurf get shortening through the omni_run tool, while Cline, Roo, OpenCode, VS Code, Zed, Copilot and Antigravity connect as MCP with built-in memory. The contexere stats command shows the savings on your own history, and contexere doctor checks that hooks fire and redact secrets.

Who it is for. For developers who work heavily in Claude Code, Codex and Cursor, pay for tokens and want to cut the extra output of builds, tests and repeated reads.

Good fit when

  • Your agent runs long builds and tests and the context fills with progress instead of the verdict and failed checks
  • The agent keeps reading the same file, and every repeat costs the full size
  • Command output may show tokens or passwords and you want them hidden before the model reads them
  • You want to see how many tokens the program saved on your own history with contexere stats
  • You connect several agents, from Claude Code to Cursor, and want one program instead of separate setups

Not a fit when

  • You need no byte of output ever changed: Contexere rewrites the output of noisy commands, although what it cuts can be restored
  • You rely on its redaction as protection: a failing command passes through as printed, so a key in its output reaches the agent
  • You use an agent that is not on the supported list and supports neither hooks nor MCP
  • The gain is not obvious for you: savings depend on what the agent does, and the developer suggests checking your own figure with contexere stats

Example request

Install Contexere, connect it to Claude Code, run contexere doctor and show that the hooks fire and redact secrets

Limitations

  • Full output shortening before the model reads it works only in agents of the top tier; the rest get shortening through omni_run or a connection as MCP.
  • Codex runs only hooks it trusts: after contexere init --codex, start codex once and approve them.
  • The gain depends on what the agent does, and the developer puts the overhead at about 21 milliseconds per command.
  • A failing command passes through unreduced, so a secret it prints reaches the agent.
  • The project was renamed: it used to be called OMNI, and the omni command keeps working. The old name still appears in repository, plugin and documentation addresses.

How to disable. The README has no separate removal guide. If you installed through Homebrew, brew uninstall contexere removes the program, and the hooks in agent settings have to be removed by hand. Before that contexere doctor shows which agents are connected.

FAQ

How do I cut token use in Claude Code?

Install Contexere with brew install fajarhide/tap/contexere and run contexere init, choosing Claude Code. After that the hooks work on their own: repeated file reads become short handles and build and test noise stays out of sight. contexere stats shows the real gain.

Is information lost when Contexere removes it?

According to the developer, no: what it cuts stays on your machine and one command brings it back. The agent receives a short marker with a handle and can ask for the full text.

Which agents does Contexere support?

Claude Code, Codex CLI, Gemini CLI, OpenClaw, Hermes, Pi and Aider get full output rewriting. Cursor and Windsurf use omni_run, and Cline, Roo, OpenCode, VS Code, Zed, Copilot and Antigravity connect as MCP with memory.

How is Contexere different from OMNI?

It is the same project after a rename. The old omni command keeps working, so existing installs need no change. The developer plans to grow Contexere into a shared place for the skills, credentials and memory of all agents, while today it ships the context and token layer.

How do I check that Contexere is set up correctly?

The contexere doctor command runs each agent's hooks with a canary secret and checks that they fire and hide it. With the --fix flag it tries to repair the wiring.

Discussion

No questions or reviews yet.

CLI tools

Indexes project files and composes a short task context into a file so the agent is not buried in noise

CLIExtended access62Repository stars

A local proxy and plugin for Claude Code and Codex that trims tool output, keeps the prompt cache warm and shows the savings

PluginBroad access74Repository stars

Viden is a terminal cockpit for a coding agent: chat with a model, approve edits and supervise Codex and Claude in one window.

CLIBroad access86Repository stars

A CLI that strips ballast from Claude Code sessions, watches context with a background guard and preserves Agent Teams state

CLIBroad access430Repository stars

Compozy runs Claude Code, Codex and Cursor sessions: a task board, scheduled check-ins and a call to you only when needed.

CLIBroad access2.9KRepository stars

A local context layer for coding agents: it understands the task, routes and compresses context and tracks the cost

CLIExtended access3.9KRepository stars

Comparison with similar tools

Cards that share the main search query, and how they differ.

ToolOfficialAuthenticationRepository starsMain difference
Contexere (this card)no377
RTKno86,384a Rust proxy that compacts git and test output, with no handles for repeated file reads
Context Modenonot required34,013an MCP server that moves large tool results out of the context into storage
Headroomyesnot required79,542local context compression for agents: output, logs, files and RAG chunks

README in short

The README briefly explains why a layer between an agent and command output is needed and lists the output handling rules. It then shows a before and after comparison, installation through Homebrew and scripts, the main commands, three tiers of agent support and links to documentation and the security policy.

README badge

Report a problem