ClaudeCodeMod

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.

In your shell
claude plugin marketplace add ray-amjad/claude-code-mods
claude plugin install secret-box@claude-code-mods
Open the repo

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

secret-box: on the left Claude calls secret-box - request_secret for STRIPE_SECRET_KEY and waits; on the right the secret box pane asks for STRIPE_SECRET_KEY with the reason, and the value field shows only dots; below, the four steps: Claude calls a tool, you paste into a masked box, the mod writes .env and .gitignore, Claude gets a placeholder that turns into the key when a tool runs
From the author's repo.

What it hooks into

  • session.startWhen a session starts
  • tool.callAround a tool call, where it can hold oneBash
  • prompt.mentionA Claude Code event
  • ui.renderDraws into the sessionPaneAbovePrompt
  • ui.closeWhen its pane closes
  • prompt.submitWhen you send a prompt
  • prompt.contextA Claude Code event
  • prompt.attachmentA Claude Code event
  • agent.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
Repo
ray-amjad/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

Other mods in Safety

secret-shieldSingh-APHolds a commandReplaces API keys, tokens, private keys, and passwords in tool output with a redaction marker before the model or the transcript sees them.transcript-redactorray-amjadSwaps secrets and email addresses in the session for stable placeholders, and puts the real value back on the way into Bash, Write, and Edit.safe-deletecharlie947Holds a commandMoves the files Claude deletes to the Bin instead, toasts a receipt, and /undo-delete puts the last batch back.loop-detectiveYeonwooSungOpens a case when the same Bash command fails the same way again, ties it to the edits that followed, and shows the live cases in a pane and a status line.display-redactionmelodic-softwareMasks email addresses and secret-shaped text in what Claude Code draws, and leaves the transcript, the model's context, and the files unchanged.jev-permission-gatemadisonrickertHolds a commandHolds routine tool calls in auto mode for Jev to allow or deny, and sends the uncertain ones on to Claude Code's built-in classifier.subagent-wallerikdarlingdataHolds a commandHolds a subagent after a time limit to git, gh, and Markdown or text writes, and nudges a code-changing subagent that has edited nothing.public-repo-guardSzotaszHolds a commandAsks in a popup before a push to a public GitHub repo, or before one goes public, when outgoing commits hold keys, emails, local paths, or private repo names.agentic-qe-fleetproffesor-for-testingHolds a commandHolds a command that would delete or overwrite .agentic-qe learning data, and toasts when the guard is set to notify.secrets-guardBioInfoHolds a commandDenies writes of secret files and credential-shaped content, and Bash that would print those secrets.wp-credential-guardnathanonnHolds a commandMasks a WordPress username and application password, refuses a slash command that carries one, and denies Bash when a placeholder is unknown.cockpittsergeytovarovHolds a commandDraws context weather and the plan limits above the prompt, and can stop a dangerous command.
All 73 in Safety