keepmum

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

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

Where it stops

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.

Download for Mac

keepmum also works with Codex, the Antigravity CLI, Gemini CLI, pi and opencode. See how it works.