Safe Keys, a Claude Code mod that keeps the API keys you paste out of the conversation, the transcript, the screen and the model while your tools still use them.
A Claude Code mod. Paste an API key into the chat and it becomes a name everywhere: the transcript on disk, the screen, the model. Your tools still use it as $NAME.
⭐ Found something useful? Star the repo. It takes a second and helps the next person find it.
Safe Keys
You are working with Claude Code. A service emails you a new API key. You paste it into the chat and say "set this". That key is now in the conversation, in the transcript file on your disk, on your screen, and in the model's context. It stays in that transcript for as long as the file exists.
Safe Keys is a Claude Code mod that catches the key the moment you submit it, stores it outside the conversation, and shows it everywhere as a name instead: $OPENROUTER_API_KEY, $BRIGHTDATA_API_KEY, $SAFE_KEY_1. When a tool needs the real value, it gets it, for that one command, and the output that comes back is cleaned before the model reads it.
A mod is a plugin whose code runs inside Claude Code itself, on events such as a submitted prompt, a tool call, or a row being drawn. That is what lets Safe Keys act before the key reaches the transcript, which no settings hook, skill or MCP server can do.
I built it after pasting a Bright Data key into my own session and watching the redactor I had at the time miss it. The miss is explained in docs/DETAILS.md, and the fix is the context rule in lib/detect.js.
Claude Code asks once whether to add the marketplace (y), then which scope to install at. Choose Install for you. The mod is active in that session from then on, and in every session after it.