ClaudeCodeMod

All shelves / Mods / Safety

secret-env

By toy-crane

secret-env is a Claude Code safety mod by toy-crane.

Opens a pane for typing an API key into a .env file, shows [hidden] wherever the value appears in tool results, and denies Write and Edit on that key's line.

DrawsHolds a command

Install

The marketplace name is toycrane.

In Claude Code
/plugin marketplace add toy-crane/skills
/plugin install secret-env@toycrane
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.1.0
License
MIT
Repo stars
5
Last change
2026-10-22

What it can reach

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

Run it in a terminal session. Add the marketplace first with /plugin marketplace add toy-crane/skills if you have not. Claude calls request_secret with a name, a purpose, and a .env file; save or cancel in the pane, and /secret-env opens the list of keys the project manages. When the file is not covered by .gitignore, the pane warns you and offers to add it before saving. Values shorter than four characters are refused. The text field does not mask what you type, so mind screen sharing, and the phone app has no text field. With the mod off or failed to load, Claude reads the value like any other file.

The marketplace, toycrane, also holds toycrane-skills, a bundle of the author's agent skills; secret-env installs on its own. Keeping API keys out of Claude's sight is why this page files it under safety. secret-guard 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. secret-shield replaces API keys, tokens, private keys, and passwords in tool output with a redaction marker before the model or the transcript sees them. This one starts from the other end: Claude asks for a key by name, a pane opens for you to type the value, and it is written to the .env file you are shown, so Claude learns only that it was saved. From then on that exact value shows as [hidden] in every tool result, in later sessions too, since the mod remembers each key by name and file and reads the value back from the file. The README says a command that encodes the value or prints part of it gets past the filter.

Demo

The top of the author's README: when Claude needs an API key it asks by name, a pane opens beside the chat with the key's name, its purpose and the .env file, you type the value and save, and Claude only learns that the key was saved; from then on every tool result shows [hidden] wherever the value appears, also in later sessions. The repository has no picture.
Screenshot of the author's GitHub page.

What it hooks into

  • session.startWhen a session starts
  • command.runWhen you run its slash command/secret-env
  • tool.callAround a tool call, where it can hold onemcp__secret-env__request_secretWriteEdit
  • ui.closeWhen its pane closes
  • ui.renderDraws into the sessionPane

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

Slash commands 1

  • /secret-envList, add, or delete the secret keys Claude cannot see

Files

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

Facts

Author
toy-crane
Category
Safety
Marketplace
toycrane
Repo
toy-crane/skills
Folder
mods/secret-env
Version
0.1.0
License
MIT
Repo stars
5
Last change
2026-10-22
Language
Shell
Files
18

Other mods in Safety

mod-blast-radiusv-amorimHolds a commandHolds a risky Bash command on a card until you choose Run or Cancel, shows what it would change first, and reads your own rules from a JSON file.mod-collision-guardv-amorimHolds a commandPauses a file edit when another open session just edited that file, and asks you to proceed, move to a worktree, cancel, or type an instruction for Claude.secret-guardvumichienHolds a commandHides 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.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.
All 73 in Safety