Shim CLI · Open source
The privacy and control layer for coding agents
Shim CLI runs on your machine next to Claude Code, Codex and Copilot. It finds secrets and personal data in what your agent sends, masks what it can before the model reads it, and shows what each session cost.
- Apache-2.0
- v1.0.0
- macOS and Linux
- Python 3.10 to 3.13
Install
uv · in your terminal, adds shim to ~/.local/bin
uv tool install --python 3.12 --compile-bytecode shimTry this prompt
in Copilot CLI, or Claude Code and Codex with enforce mode on
Hello, my email is "alice@example.com" and my IBAN is "TR33 0006 1005 1978 6457 8413 26". What is my email domain and the last 4 digits of my IBAN?What it does
Two commands, two questions
Protect every session automatically, or measure one session to see where your tokens and data actually went.
shim install claudeMask sensitive data, every session
Installs a native hook in your agent. When the agent reads a file or a tool result holding a key, an IBAN or an email, the model gets a placeholder like <SECRET_1> instead of the value.
shim watch -- claudeSee what a session sent and cost
Runs a local proxy for one command and reports tokens, spend and every secret or personal value that went past. It changes nothing, writes no request to disk and leaves nothing behind.
Quickstart
Start with three commands
Pick your coding agent. Nothing here needs an account, an API key or a network call to shim.
Install the CLI
uv tool install --python 3.12 --compile-bytecode shimUse pipx instead
pipx install --python python3.12 shimConnect it to Claude Code
Preview the change first, then install the hook.
shim install claude --dry-runshim install claude
Check that it works
shim doctor claudeThen use Claude Code as you normally do. Masks secrets and personal data in the files and tool results your agent reads, before the model sees them.
Prefer a plugin?
Install from the Claude Code marketplace instead of running shim install. Use one method, not both.
/plugin marketplace add GetSHIM/shim-cli/plugin install shim-cli@shim-cli
Install the CLI
uv tool install --python 3.12 --compile-bytecode shimUse pipx instead
pipx install --python python3.12 shimConnect it to Codex
Preview the change first, then install the hook.
shim install codex --dry-runshim install codex
Check that it works
shim doctor codexThen use Codex as you normally do. Reports what it found in your prompt and lets it through. Switch to enforce mode to block it instead.
One more step in Codex
Codex skips a hook until you trust it. Open /hooks in Codex, review the shim entry and enable it. Prefer a plugin? Run these instead of shim install, then trust the hook the same way.
codex plugin marketplace add GetSHIM/shim-clicodex plugin add shim-cli@shim-cli
Install the CLI
uv tool install --python 3.12 --compile-bytecode shimUse pipx instead
pipx install --python python3.12 shimConnect it to Copilot CLI
Preview the change first, then install the hook.
shim install copilot --dry-runshim install copilot
Check that it works
shim doctor copilotThen use Copilot CLI as you normally do. Replaces the prompt the model receives with the redacted text, so the original values never reach it.
What it detects
Found locally, checked where it can be
IBANs and Turkish IDs are verified by checksum, so a mistyped number is not reported. Add your own project names or host formats as patterns.
- Email addresses
- Phone numbers
- Credit cards
- IBANs
- Turkish national IDs
- Turkish tax IDs
- API keys and secrets
- Database URIs
- IP addresses
- MAC addresses
- US SSNs
- Your own patterns
What you see
A summary at the end of the turn
A real Claude Code session on a customer file. Every value was replaced before the model saw it, and a document trying to give the agent orders was flagged.
masked 60 EMAIL (Read customers.csv)
60 IBAN (Read customers.csv)
60 PHONE (Read customers.csv)
60 TR_NATIONAL_ID (Read customers.csv)
flagged 1 INSTRUCTION_OVERRIDE (Read runbook.md)
1 HIDDEN_TEXT (Read runbook.md)
overhead 62 ms median, 119 ms p95How it is verified
Measured on the released build
- tests run on every release
- 1,900+tests run on every release
- median hook cost, interpreter start included
- 70 msmedian hook cost, interpreter start included
- detector cases, graded on exact output
- 589detector cases, graded on exact output
- accounts, API keys or telemetry added by shim
- 0accounts, API keys or telemetry added by shim
Before you rely on it
What Shim CLI does not do
- By default a secret you type into a Claude Code or Codex prompt is reported, not stopped. Turn on enforce mode to block the prompt instead.
- The output of a failed tool call is not masked. Claude Code sends it to a hook event shim does not install.
- Detection is best-effort and can miss a value. It narrows exposure, it is not a data-loss prevention boundary.
- shim watch supports Claude Code only for now.
Free, open source, yours to read
The whole CLI is on GitHub under Apache-2.0. Read the detector, run the tests, open an issue or send a pull request.
For your whole team
Protect your applications too
Shim Enterprise puts the same protection in front of the AI traffic your products send, with audit, budgets and roles.
Explore Shim Enterprise