ClaudeCodeMod

All shelves / Mods / Safety

secret-guard

By arasovic

secret-guard is a Claude Code safety mod by arasovic.

Hides API keys and private keys before the model or the transcript sees them, blocks credential files and commands that print secrets, and shows what it caught.

DrawsHolds a command

Install

The marketplace name is claude-code-mods.

In your shell
claude plugin marketplace add arasovic/claude-code-mods
claude plugin install secret-guard@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.4.0
License
MIT
Repo stars
7
Last change
2026-10-25

What it can reach

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

Tested on Claude Code 2.1.296. Restart after installing. The marketplace name is claude-code-mods, the same string hamzafer uses. Add arasovic/claude-code-mods. Known key formats in what tools return, and in your own messages, become a [secret-guard: rule] tag before Claude reads them, and the transcript on disk keeps the hidden form: AWS, GitHub, GitLab, Slack, Stripe, Google, Anthropic, OpenAI, and other keys, private key blocks, JWTs, secret-named values, connection URL passwords, Authorization values, and URL credentials. It blocks reading or editing credential files such as .env, SSH and GPG private keys, ~/.aws/credentials, shell history, browser cookie and password stores, and password manager data, while templates such as .env.example and public keys stay readable. It blocks commands that print secrets, such as printenv, gh auth token, or an echo of a token variable, and any command, web request, or MCP call that would send a key out. Claude can call its env_check tool to learn whether an env file sets a variable, without seeing the value. A status light under the prompt is green for nothing seen, yellow for something hidden, and red for something blocked, and says env scrub off until you set CLAUDE_CODE_SUBPROCESS_ENV_SCRUB to 1 in the env block of ~/.claude/settings.json.

The marketplace, arasovic's claude-code-mods, also holds guardrails, loop-guard, pin-board, and other mods by the same author. This one installs on its own; to update, run claude plugin marketplace update claude-code-mods, then claude plugin update secret-guard@claude-code-mods. Keeping keys out of the conversation is why this page files it under safety. secret-shield, 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. transcript-redactor, by ray-amjad, 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. This one also blocks credential files and commands that print secrets, and refuses a write that would put a hidden tag back over the real value. The author lists what gets through: where Claude Code's built-in Security default plugin runs first, files added with @, summaries, skill text, and some other rows reach Claude unhidden; a script Claude writes can open any file; commands are read in sh, bash, and zsh form only; and a secret in a format it does not know passes. If a check itself fails, the call is refused. Its plugin.json names Mehmet Aras as its author.

Demo

Secrets hidden before the model sees them, with a status light
From the author's repo.

What it hooks into

  • session.startWhen a session starts
  • tool.callAround a tool call, where it can hold one
  • session.appendWhen an entry is written to the transcript

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, 4 files. They load when you open them.

Facts

Author
arasovic
Category
Safety
Marketplace
claude-code-mods
Repo
arasovic/claude-code-mods
Folder
secret-guard
Version
0.4.0
License
MIT
Repo stars
7
Last change
2026-10-25
Language
TypeScript
Files
9

Other mods in Safety

guardrailsarasovicHolds a commandHolds Cloudflare write commands, attribution lines in commits and pull requests, and branch names that start with claude/.guardrails-liteedtrackaiHolds a commandHolds a read of a secret .env file, a git force-push, and a recursive rm on /, ~, or $HOME. .env.example, .env.sample, and .env.template are allowed.injection-guardSingh-APStrips hidden characters from tool output and marks results that carry instructions aimed at Claude, so they reach it as untrusted data.collision-guardnateherkaiHolds a commandHolds an edit to a file another open chat changed in the last 30 minutes, and asks you to proceed, move this chat to a worktree, or cancel.recording-modenateherkaiHolds a commandMasks keys, personal details, and business figures on screen while you record, hides results from mail, chat, and finance tools, and keeps private files closed.secret-boxray-amjadHolds a commandOpens 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.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.
All 73 in Safety