By kenhuangus
Eight small, local Claude Code security mods: deterministic guardrails inside the process loop. Each mod is one folder under mods/.
npx claudepluginhub kenhuangus/claude-code-security-modsLocal deterministic pattern bridge for new file content. Not the official Claude Security plugin and not a data-flow scanner.
Appends architecture rules as Claude-only context on every prompt, and drops prompts that explicitly tell Claude to ignore or bypass security rules.
Default-closed eval gate. External Promptfoo runs in CI are the real gate; this mod is defence in depth only.
Short-lived credential gate. Fetches a token from a configured broker only; it never invents a token and never falls back to a long-lived credential.
Redacts secret patterns from prompts, shell commands and shell output, blocks writes that contain secrets, and denies reads and mentions of secret files.
Per-session token tally. Records usage totals in the store and prints the turn total; it is not a token stream or a server-side audit chain.
Local deterministic guard for dangerous Bash and PowerShell commands. Not the Rulebricks product; no network calls.
Observable audit trace only. Records tool calls and turn completions to a capped store log; it never blocks work.
7-day visitors to each marketplace page
Eight small, local Claude Code mods (plugins with hooks modules) that add
deterministic guardrails inside Claude Code's process loop. Each mod is one
folder under mods/, with its own plugin.json, hooks/hooks.json,
hooks/register.js, pure hooks/policy.js, and README.md. The repository is
also a plugin marketplace, so any mod installs with one line.
Public repo: https://github.com/kenhuangus/claude-code-security-mods
At the prompt of a terminal session (Claude Code 2.1.275 or later):
/plugin install design-guard --marketplace kenhuangus/claude-code-security-mods
Answer y to add the marketplace, then pick a scope. Replace design-guard with any
mod below. From a shell:
claude plugin marketplace add kenhuangus/claude-code-security-mods
claude plugin install secret-scrubber@claude-code-security-mods
Without installing, for one session, from a clone of this repository:
claude --plugin-dir ./mods/design-guard
In the desktop app, where /plugin does not run: click + next to the prompt box, then
Plugins, Add marketplace with kenhuangus/claude-code-security-mods, then Add plugin.
Read a mod's README before installing it: see the security warning below.
| Mod | Correct events | What it does |
|---|---|---|
design-guard | prompt.submit, command.run (design-rules) | Appends architecture rules as Claude-only context; drops only prompts that tell Claude to ignore/bypass security rules, not questions about attacks |
code-scan-bridge | tool.call (Edit/Write/MultiEdit/NotebookEdit) | Local pattern bridge for new content (cloud keys, GitHub/Anthropic/OpenAI/Google/Slack tokens, private keys, passwords), NOT the official Claude Security plugin and NOT a data-flow scanner |
secret-scrubber | prompt.submit, tool.call (Bash/PowerShell, file writes, Read), prompt.mention | Redacts secrets in prompts, shell commands and shell output; refuses writes that contain a secret; denies reads and mentions of secret files |
eval-gate | tool.check (shell and file tools), command.run (eval-gate) | Default-closed, per-session gate; external Promptfoo in CI is the real gate, this is defence in depth |
trace-audit | tool.call, turn.complete | Observable trace only, capped at 500 store entries; never blocks work |
tool-call-guard | tool.call (Bash, PowerShell) | Local deterministic guard for dangerous Bash, PowerShell and cmd commands, NOT the Rulebricks product; no network calls |
nhi-scoper | command.run (nhi-refresh, nhi-revoke), tool.call (Bash, PowerShell) | Short-lived token gate fed by your broker; the token lives in the environment, not the store |
token-tally | turn.complete, tool.call, command.run (token-tally) | Per-session token totals; NOT a token stream and NOT a server-side audit chain |
0.1.0 passed its own tests, but those tests used a hand-made stand-in for the engine, so
they could not notice where the mods disagreed with the real API. Checking the code
against the type definitions that ship with Claude Code, and then running each mod in
real claude -p sessions, found these defects:
commands/*.md files register a namespaced prompt skill
that the model runs; the command.run hooks only fire for commands registered on $
with $.command.register. /design-rules, /eval-gate, /nhi-refresh and
/token-tally did nothing useful. They are registered properly now.nhi-scoper could not work against a real broker. $.http.fetch resolves
{ status, ok, headers, text }, and the mod read response.token from it.eval-gate was machine-wide. tool.check and command.run carry no session id,
so every pass was stored under one global key shared by all sessions for 24 hours.secret-scrubber redacted nothing from shell output (the result is
{ result: { stdout, stderr } }) and rewrote source files silently, turning
token = "abc" into the invalid token=[REDACTED].PowerShell tool, so on Windows each could be sidestepped.token-tally cut the turn.complete chain and labelled a machine-wide count a
session total.design-guard dropped security questions such as "how do attackers bypass
security rules?".C:\Users\me\.ssh\id_rsa) were not recognised as secret paths.brokerUrl and evalCommand could not be set: no manifest declared userConfig.Each mod's README has its own "What changed from 0.1.0" section.
The original idea list contained claims that do not match the primary Claude Code docs. This repo corrects all of them, and the per-mod READMEs repeat the correction where it matters:
RuFlo Marketplace: Claude Code native agents, swarms, workers, and MCP tools for continuous software engineering
Claude Code marketplace entries for the plugin-safe Agentic Awesome Skills library and its compatible editorial bundles.
Directory of popular Claude Code extensions including development tools, productivity plugins, and MCP integrations