keepmum › Claude Code
Keep your keys out of Claude Code’s requests
Last updated November 19, 2026
Claude Code reads your .env to fix a failing deploy, runs printenv to see why a test can’t connect, and gets a stack trace with a connection string in it. All of that becomes part of the conversation, and every request sends the conversation to Anthropic. keepmum is a free, open-source proxy on your Mac that masks those values before the request leaves and puts them back when the answer comes in, so Claude Code keeps working with the real values and Anthropic never receives them.
What changes
Claude Code reads a .env file. What it holds, and what goes to Anthropic:
# on your Mac
DATABASE_URL=postgres://app:Zq8vX2mN4pL7kR9t@db.internal:5432/app
STRIPE_SECRET_KEY=sk_live_51Hx8fQ2eZvKYlo2C7a9Rb
# sent to Anthropic
DATABASE_URL=postgres://app:KEEPMUM_SECRET_3b91d0aa@db.internal:5432/app
STRIPE_SECRET_KEY=KEEPMUM_SECRET_7f3a9c2e
Only the secret is replaced: Claude still sees which database, host and port it is working with. When Claude answers with an edit to that file or a command that uses the key, keepmum swaps the placeholder back on your Mac, so the edit and the command get the real value. The same value always gets the same placeholder, so Anthropic’s prompt cache keeps working.
Set it up
keepmum runs on a Mac with Apple silicon and macOS 14 or later. Pick one way in.
The Mac app: every Claude Code session
Download the app, drag it into Applications, open it and follow Setup: download the model, start the background service, and switch on protection for Claude Code. That covers Claude Code in the terminal, in VS Code and in the desktop app.
The terminal: one session
With the command line installed, start Claude Code through keepmum. Arguments pass through to claude.
keepmum claude
The command line: every session
keepmum serve # the proxy, on http://127.0.0.1:7788
keepmum protect on # Claude Code now sends every session to it
keepmum protect on sets env.ANTHROPIC_BASE_URL in ~/.claude/settings.json, after backing the file up, and keepmum protect off removes only what it added. Open sessions switch at once. keepmum serve must keep running while protection is on; the Mac app runs it at login.
VS Code, with the command line
Add this to your VS Code settings (JSON) and reload the window. Each conversation then starts through keepmum.
"claudeCode.claudeProcessWrapper": "/Users/<you>/.local/bin/keepmum-claude-wrapper"
Check that it works
keepmum doctor # every line should be ✓
keepmum selftest # fails if a test secret gets past keepmum
To see what keepmum would catch before it changes anything, keepmum observe on scans and counts but sends every request as Claude Code wrote it. keepmum observe off masks again.
What gets masked
- Always, secrets: API keys, tokens, passwords, private keys and connection strings, in code, config files, command-line flags and plain sentences. Output Claude Code prints encoded, such as
xxd .envorbase64 < .env, is decoded and scanned too. - If you turn it on, personal data (
keepmum pii on): names, emails, phone numbers, addresses, account numbers and dates of birth. - Your own rules:
keepmum rules maskadds a pattern,keepmum rules allowlets an exact value through.
Detection runs on your Mac: 96 rules with entropy and checksum checks, then a local model on the Mac’s GPU. If keepmum can’t scan a request, it blocks it rather than send it raw.
What Claude Code can still do
- Edit files and run commands with the real values. A placeholder in a file edit or a shell command is put back first, quoted for the shell or escaped for JSON as needed, so
git push, your tests and a database login keep working. - Use MCP servers, with less. A server gets back only the values it returned itself, so a search can be followed by opening what it found. Web search and web fetch keep placeholders. None of them ever gets a secret.
- Not send a known token somewhere else. A token whose issuer keepmum knows (GitHub, Stripe, AWS, OpenAI and 68 more) stays a placeholder in a command that would send it to any other host.
Where it stops
- Shell commands get real values. A password, or a command built to hide where it sends things, can get past the check above. Use keepmum together with Claude Code’s sandbox: keepmum controls what Anthropic sees, and the sandbox controls what commands can reach.
- Your local history keeps real values. Claude Code’s transcripts on your disk hold the restored conversation. keepmum protects what leaves your Mac, not what is stored on it.
- Remote Control is off. Claude Code turns Remote Control off while its requests go through a proxy. Use an unprotected session when you need it.
- Images and PDFs pass unscanned, and the local model is strongest on English.
- keepmum is alpha and not yet independently audited. Every limitation, in full.
Questions
Does Claude Code send my .env file to Anthropic?
If it reads it, yes. A file Claude Code reads, or a command’s output, becomes part of the conversation, and each request sends the conversation to Anthropic’s API. With keepmum in between, the keys and passwords in it go as placeholders.
Can’t I just tell Claude Code not to read .env?
You can deny it in Claude Code’s permission settings, and it is worth doing for files it never needs. But then it cannot work with what is in them, and secrets also arrive other ways: in a command’s output, a log, a config file under another name, or something you paste. keepmum covers whatever text the request holds.
Can I leave one project out?
Yes. keepmum exclude with the project’s folder makes Claude Code there go straight to the API, unscanned, and keepmum include scans it again. The Mac app lists exclusions in Settings.
How much slower is Claude Code with keepmum?
About 100 to 145 ms a request at the 95th percentile for 4K tokens of new text; earlier turns are cached. With the rules alone (keepmum model off), 8 to 9 ms.
keepmum also works with Codex, the Antigravity CLI, Gemini CLI, pi and opencode. See how it works.