ClaudeCodeMod

All shelves / Mods / Safety

secret-guard

By vumichien

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

Hides secret values from your env files and secret-shaped text in tool results, tells Claude to use $NAME instead, and refuses commands that print them.

DrawsHolds a command

Install

The marketplace name is chien-mods.

In your shell
claude plugin marketplace add vumichien/claude-code-mods-kit
claude plugin install secret-guard@chien-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
4
Last change
2026-10-10

What it can reach

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

Start a new session after installing. Tested on Claude Code 2.1.296 on Windows 11; mods are an early-access feature, so the API can change between versions. It starts on, unlike the other seven mods in the marketplace. It reads the env files at session start, so a value added later is protected from the next session, and a file outside the folders above the session is read only when secretFiles names its path. The README says it is not a security boundary: in the author's tests it missed a base64-encoded copy of a value, and a secret printed bare, in no env file, is not recognised. The mode option is value by default; command instead refuses any call whose command or path names a protected env file. To try it for one session without installing, git clone the repository and start claude with --plugin-dir pointing at the mod's folder.

The install name is secret-guard, which another listed mod already has, so this page adds the author's name. The marketplace, chien-mods, also holds plan-meter, done-gate, context-meter, idea-shelf, session-monitor, prompt-enhancer, and assumption-check, each installed on its own. Keeping secrets 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. secrets-guard, by BioInfo, denies writes of secret files and credential-shaped content, and Bash that would print those secrets. This one reads every .env and .env.* from the session's folder up to the drive root when a session starts, hides those values and anything that looks like a secret in every tool result, and tells Claude in every conversation to use $DB_PASSWORD instead of printing the value. It refuses a bare env or printenv, cat and its kin on a protected file, aws ssm with decryption, and kubectl get secret as YAML or JSON unless the output goes to a file or a variable. It never refuses loading a file, as source .env does. In the source, the status line reads secret-guard: N hidden this session.

Demo

A paragraph of the author's claude-code-mods-kit README on secret-guard: every conversation starts with a short # secret-guard note to Claude giving the protected files and key names (names only), what the ‹hidden: NAME› marker means, and the convention to reference $NAME, let scripts load the env file, and never print a secret; the note is rebuilt after a compaction or /clear, and messages sent to other agents and what Claude Code attaches on its own are scrubbed like tool results.
Screenshot of the author's GitHub page.

What it hooks into

  • session.startWhen a session starts
  • prompt.contextA Claude Code event
  • command.runWhen you run its slash command/secret-guard
  • tool.callAround a tool call, where it can hold one
  • prompt.attachmentA Claude Code event
  • session.sendA Claude Code event

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

Slash commands 1

  • /secret-guardShow which env files and keys secret-guard protects (/secret-guard on or off switches it)

Files

The author's source, 3 files. They load when you open them.

Facts

Author
vumichien
Category
Safety
Marketplace
chien-mods
Repo
vumichien/claude-code-mods-kit
Folder
plugins/secret-guard
Version
0.4.0
License
MIT
Repo stars
4
Last change
2026-10-10
Language
TypeScript
Files
9

Other mods in Safety

blast-radiusAnthropicHolds a commandHolds a shell command such as rm -rf, a force push, a hard reset, or a migration, shows what it would touch, then asks you to proceed or cancel.merge-gatehamzaferHolds a commandHolds gh pr merge until CI is green and a Codex review has run once, and draws that pull request's status above the prompt.rulebook-guardhamzaferHolds a commandAsks before git commit --amend, an unformatted push, or personal details in notes and commits.bash-guardSingh-APHolds a commandHolds every Bash call, even in bypass mode. Blocks rm -rf on a home or system directory, and asks before a force-push, a hard reset, or a pipe into sh.net-guardSingh-APHolds a commandHolds curl, wget, ssh, scp, git push, and WebFetch, even in bypass mode. Blocks paste sites and request catchers, and asks before data goes anywhere new.file-guardSingh-APHolds a commandHolds writes outside the project and writes into .git, and asks before lockfiles and CI files.slopsquat-guardSingh-APHolds a commandHolds a package install and checks the name against its registry, so a hallucinated or typosquatted package does not install.command-explainerSingh-APDraws a plain-English line and a risk level on the permission prompt, so you can see what the command does before you approve it.secret-guardarasovicHolds a commandHides 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.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.
All 73 in Safety