All shelves / Mods / Safety
secret-box
By ray-amjad
secret-box is a Claude Code safety mod by ray-amjad.
Opens a masked box when Claude needs a key, writes the key to .env, and gives Claude a placeholder; any key a tool prints comes back as a placeholder too.
DrawsHolds a command
Install
The marketplace name is claude-code-mods.
claude plugin marketplace add ray-amjad/claude-code-mods claude plugin install secret-box@claude-code-mods
It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.
- Version
- 0.5.3
- License
- MIT
- Repo stars
- 94
- Last change
- 2026-10-18
What it can reach
- Draws in the session
- Holds a command
- Sees tool calls
Tested with Claude Code 2.1.296. Mods load only in a folder you have trusted, so in a new repo accept the trust prompt first. Claude asks through the mod's request_secret tool, with a variable name and a one-line reason, and a pane opens beside the transcript with a field that only ever draws dots and a character count. Enter writes NAME=value to .env, makes sure .gitignore covers it, and gives Claude a placeholder; Esc cancels and nothing is written. The placeholder turns into the real key when Bash, Write, Edit, MultiEdit, or NotebookEdit runs, the tools in restoreTools. Every tool result is scanned before Claude sees it, for about 70 vendor key shapes, passwords on command-line flags and in connection strings, high-entropy tokens, and every .env value with a secret name, and a key pasted into the prompt by mistake becomes a placeholder too. git add .env, and a git commit that would carry a .env file, are refused. Under 144 columns the box draws in the band above the prompt, and you press ctrl+x then Tab to type in it. claude -p and SDK sessions get no request_secret tool, though redaction and the .env guard still run there. Settings, such as pii for email addresses and public IP addresses, are set with /plugin configure secret-box@claude-code-mods.
The marketplace name is claude-code-mods, the same string hamzafer, arasovic, and karanb192 use. Add ray-amjad/claude-code-mods. The marketplace also holds transcript-redactor, decision-tree, diagram-pane, and other mods. This one installs on its own. Keeping keys out of the transcript is why this page files it under safety. transcript-redactor, by the same author, swaps secrets and email addresses in the session for stable placeholders and puts the real value back on the way into Bash, Write, and Edit; the author says secret-box already includes it, so run one or the other, not both. secret-guard, by arasovic, hides API keys and private keys before the model or the transcript sees them, and blocks reads of credential files. This one also gives Claude a way to ask you for a new key. The author says it hides what Claude reads, not what Claude does: Claude can still run a command that transforms the key or sends it somewhere, so it is not a sandbox against a model that is trying to leak one. A command that runs git commit or gh pr gets no real values, a placeholder in a file Claude writes lands on disk as the key, and the placeholders live in memory for one session only.
Demo

What it hooks into
session.startWhen a session startstool.callAround a tool call, where it can hold oneBashprompt.mentionA Claude Code eventui.renderDraws into the sessionPaneAbovePromptui.closeWhen its pane closesprompt.submitWhen you send a promptprompt.contextA Claude Code eventprompt.attachmentA Claude Code eventagent.spawnWhen a subagent starts
Read from the on() calls in its hook modules. Open its source under Files to check what each one does.
Files
The author's README and source, 6 files. They load when you open them.
Facts
- Author
- ray-amjad
- Category
- Safety
- Marketplace
- claude-code-mods
- Folder
- plugins/secret-box
- Version
- 0.5.3
- License
- MIT
- Repo stars
- 94
- Last change
- 2026-10-18
- Language
- TypeScript
- Files
- 16