ctx-wire
ctx-wire runs your commands, compresses the output with declarative filters, scrubs secrets, and hands your agent a short result. The full log stays on disk for when something actually fails. Cut the noise on the wire.
ctx-wire sits between your AI coding agent and shell command output, automatically trimming noise and removing secrets before they reach the agent, saving tokens and money without changing how you work.
ctx-wire is a small Go program that sits between an AI coding agent and the output of shell commands. When an AI agent like Claude, Cursor, or Codex runs a command on your computer, the full raw output gets sent back to the agent as text. That text consumes tokens, which costs money and eats into the agent's context window. ctx-wire intercepts that output, trims it down using configurable filters, removes any secrets or credentials that appear in the text, and hands the agent a shorter version. The full unedited output stays saved on disk so you can look at it if something goes wrong.
The project describes this as "cutting the noise on the wire." The idea is that most command output contains progress bars, redundant paths, timestamps, and other noise that the agent does not actually need to make decisions. Built-in filters cover 142 common command patterns and are tested against 326 conformance cases. You can also write your own filters per project in a local configuration file.
Installation is a one-line curl command that downloads the binary to your local bin folder. After that you run ctx-wire init with the name of your agent to wire it in. The tool supports Claude, Codex, Cursor, Gemini, Copilot, and several others. Once set up, it works automatically without changing how you use your agent.
The tool also tracks how much token savings you accumulate over time. You can query that history by time period, see it as an ASCII bar chart, export it as JSON or CSV, and compare it against a monthly token budget. There are diagnostic commands to explain how any given shell command would be handled, find commands that escaped filtering, and suggest filter improvements based on your actual usage history.
It also supports the Model Context Protocol, exposing a run_command tool that agents can call directly over MCP rather than through shell hooks. The project is released and includes a full Go test suite plus a smoke test script that exercises the main end-to-end flows.
Where it fits
- Reduce your monthly OpenAI or Claude API bill by filtering out verbose build logs before they reach your AI agent
- Stop credentials and API keys from leaking into AI agent context windows when running shell commands
- Track cumulative token savings over time and compare them against a monthly budget with a built-in reporting dashboard