ClaudeCodeMod

All shelves / Mods / Safety

secret-shield

By Singh-AP

secret-shield is a Claude Code safety mod by Singh-AP.

Replaces API keys, tokens, private keys, and passwords in tool output with a redaction marker before the model or the transcript sees them.

DrawsHolds a command

Install

The marketplace name is awesome-claude-mods.

In Claude Code
/plugin marketplace add Singh-AP/awesome-claude-mods
/plugin install secret-shield@awesome-claude-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
1.0.0
License
MIT
Repo stars
3
Last change
2026-10-04

What it can reach

  • Draws in the session
  • Holds a command
  • Sees tool calls

Claude Code 2.1.287 or later. The mod is live once you run /reload-plugins or start a new session. Every tool result is rewritten before it is stored, so the model reads [REDACTED:kind] in place of a secret and the transcript keeps no copy; a second hook catches file attachments, hook context, and other rows that enter the conversation. It finds more than 20 formats, AWS keys and session tokens, GitHub, Anthropic, OpenAI, Slack, Stripe, Google, npm, PyPI, Hugging Face, and SendGrid keys, JWTs, Bearer headers, PEM private keys even half-printed, and passwords in URLs, and it keeps the name and drops the value in .env, export, YAML, TOML, JSON, and code assignments, while lookalikes such as MAX_TOKENS=1024 stay. A row it cannot scan is withheld rather than stored raw. One toast per kind of secret per session. /secret-shield shows what was hidden, and /secret-shield test dry-runs a string. blockSecretFiles, off by default, refuses Read, Edit, and Write on .env files, keys, ~/.ssh, ~/.aws/credentials, .npmrc, .netrc, kube config, and service-account JSON, with .env.example readable. redactPrompts, off by default, redacts secrets you paste into your own prompts.

The marketplace, Singh-AP's awesome-claude-mods, holds the 21 mods built there, bash-guard, net-guard, injection-guard among them, and 26 community and Anthropic mods pinned to a commit. This one installs on its own. Keeping keys out of the model's context and the transcript is why this page files it under safety. secret-guard, by arasovic, hides API keys and private keys before the model or the transcript sees them, and blocks credential files and commands that print secrets. secret-box, by ray-amjad, opens a masked box when Claude needs a key, writes the key to .env, and gives Claude a placeholder. This one scrubs what flows in, and holds file reads only with blockSecretFiles on. Detection is by pattern, so a secret with no known format and no telling name gets through; high-entropy guessing is left out because it would redact commit hashes. A secret Claude already knows, because you pasted it with redactPrompts off, can still be written to files, and the terminal may show raw output for a moment before the redacted row replaces it. Its plugin.json names awesome-claude-mods as its author, and Singh-AP owns the marketplace.

Demo

secret-shield in a real Claude Code session
From the author's repo.

What it hooks into

  • session.startWhen a session starts
  • session.appendWhen an entry is written to the transcript
  • tool.callAround a tool call, where it can hold one
  • command.runWhen you run its slash command/secret-shield

Read from the on() calls in its hook modules. Open its source under Files to check what each one does.

Slash commands 1

  • /secret-shieldWhat secret-shield has hidden from Claude, or dry-run it: /secret-shield test <text>

Files

The author's README and source, 4 files. They load when you open them.

Facts

Author
Singh-AP
Category
Safety
Marketplace
awesome-claude-mods
Repo
Singh-AP/awesome-claude-mods
Folder
mods/safety/secret-shield
Version
1.0.0
License
MIT
Repo stars
3
Last change
2026-10-04
Language
TypeScript
Files
8

Other mods in Safety

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.taxi-speedcamdevbrother2024Holds a commandStops a risky shell command and asks before it runs, shown as a taxi speed camera.
All 73 in Safety