Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By edtrackaiv0.1.2MITIn 2 marketplaces
Pattern-based checks that deny .env reads, git force pushes and rm -rf on / or your home folder before Claude Code runs them.
Code that runs inside Claude Code on every session, as you, unsandboxed.
1 critical to review before installing
JavaScript or TypeScript that runs inside Claude Code as you, unsandboxed. Read from its source, it sees, changes or blocks tool calls.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
2 marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
A small Claude Code plugin (a mod, Claude Code 2.1.287+) that checks each tool call and denies three kinds of call before they run:
.env files: Read, Grep and Glob on .env, .env.local, .env.production and similar, plus Bash readers such as cat, head, grep, cp, source and base64 on those files. .env.example, .env.sample and .env.template are allowed.git push -f, --force, --force-with-lease, combined short flags like -uf, and +refspec pushes. A plain git push runs.rm on /, ~ or $HOME: for example rm -rf ~, rm -fr /, rm -Rf $HOME/*. rm -rf node_modules runs.It is pattern-based and about 75 lines of dependency-free JavaScript (hooks/lite-core.mjs). Read it before you install it.
claude plugin marketplace add edtrackai/claude-code-guardrails-lite
claude plugin install guardrails-lite@guardrails-lite
Or inside a session: /plugin marketplace add edtrackai/claude-code-guardrails-lite, then /plugin install guardrails-lite@guardrails-lite. Run /reload-plugins or start a new session.
To try it for one session without installing: clone the repo and run claude --plugin-dir ./claude-code-guardrails-lite.
Output from the core check (node against hooks/lite-core.mjs, captured from this repo's tests):
{"file_path":"/app/.env.local"} -> {"decision":"deny","reason":"Guardrails Lite: reading /app/.env.local is blocked because .env files hold secrets. Use .env.example for variable names, or ask the user for the specific value."}
{"command":"git push --force origin main"} -> {"decision":"deny","reason":"Guardrails Lite: force push needs the user's explicit approval. Ask the user to run it."}
{"command":"rm -rf ~"} -> {"decision":"deny","reason":"Guardrails Lite: recursive rm on /, ~ or $HOME is blocked. Ask the user to run it."}
{"command":"git push origin main"} -> null
In the mod, the reason is returned to Claude Code as { deny: reason } and the tool does not run (checked by the a refused call never reaches the tool plugin test).
claude plugin validate --strict .: passes (Claude Code 2.1.300).claude plugin test .: 13 of 13 pass (tests/register.test.ts, synthetic tool-call events).node --test tests/: 36 of 36 pass (tests/core.test.mjs), including checks of the internal-error deny and of the .catch handler and a timing check that runs 60 adversarial inputs near the 64 K size cap and requires each to finish in under 50 ms.It has not been tested in a live interactive Claude Code session.
.env, git -C dir push -f variants it doesn't parse, shell variables or aliases, find / -delete, or rm -rf on other important folders.Read, Grep, Glob and Bash tool calls. MCP tools, other file tools and anything outside Claude Code aren't checked.Guardrails Lite: internal error ... to stderr (checked by a unit test in tests/core.test.mjs). Ask the user to run the call, or report the error..catch handler is skipped, and the call goes ahead. From 0.1.2 the hook has an on(...).catch(...) handler; per the same docs, Claude Code calls it when the hook throws or times out, and it denies the call if the hook had not yet passed it on. Unit tests check that the handler is attached and how it answers a simulated timeout; a real timeout has not been triggered in a live Claude Code session. If the handler itself fails, the docs say Claude Code skips the hook and the call goes ahead.--safe-mode, --bare or "disableAllHooks": true, or where your organization blocks user mods. Another mod that approves tool calls can approve a call before this one sees it.See CHANGELOG.md.
MIT. See LICENSE.
Ad (paid, from the same author): the Guardrails Pack ($24 plus VAT where applicable) has the full rule set (Supabase, Stripe, deploy and secret-egress checks, settings hooks, Cursor hooks).
Claude and Claude Code are trademarks of Anthropic. This plugin is not affiliated with or endorsed by Anthropic.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub edtrackai/claude-code-guardrails-lite --plugin guardrails-lite