Guards

5,126 mods

Guards sit in front of the tools Claude uses. They can allow, deny or rewrite a tool call before it runs, for example to block risky shell commands or keep secrets out of tool output, using the tool.call and tool.check hooks.

edits-no-commit

MatheusChiodi/cockpit

Toast once when 20 edits and an hour have passed without a commit

★ 2ToastsGuards

effect-cleanup-note

MatheusChiodi/cockpit

Tells Claude when an edit adds a useEffect that starts an interval, listener or subscription and returns no cleanup

★ 2ToastsGuards

empty-test-guard

MatheusChiodi/cockpit

Refuses a test file edit that adds test cases with no assertion in them

★ 2Guards

env-drift-band

MatheusChiodi/cockpit

Band with the keys .env.example has and .env lacks, names only, never values

★ 2BandsGuards

env-dump-guard

MatheusChiodi/cockpit

Blocks dumping the whole environment: bare env, printenv, set and export -p, Get-ChildItem Env:

★ 2Guards

env-guard

MatheusChiodi/cockpit

Protects .env files from reading and writing (Read, Edit, Write, cat and @mention)

★ 2GuardsPrompt

env-ignore-status

MatheusChiodi/cockpit

Status line that warns when a .env file is tracked by git or missing from .gitignore

★ 2Status lineGuards

env-names-context

MatheusChiodi/cockpit

Lists the environment variable names the app expects, from .env.example, never their values

★ 2GuardsPrompt

env-undeclared-toast

MatheusChiodi/cockpit

A toast when an edit reads process.env or import.meta.env variables that .env.example does not declare

★ 2ToastsGuards

error-band

MatheusChiodi/cockpit

Keeps the last failed command and its error line in view until a command passes

★ 2BandsGuards

error-context-note

MatheusChiodi/cockpit

Tells Claude when an edit throws an error whose message names nothing, like "failed" or "something went wrong"

★ 2ToastsGuards

error-pane

MatheusChiodi/cockpit

/errors opens a pane with every tool call that failed or was denied, its input and the first line of the error

★ 2PanesGuardsCommands

esm-guard

MatheusChiodi/cockpit

Refuses require, module.exports and __dirname in .js files of a package that declares "type": "module"

★ 2Guards

explore-nudge

MatheusChiodi/cockpit

After 15 reads and searches in one turn, a toast and a note to Claude to hand the rest of the exploring to a subagent

★ 2ToastsGuards

explore-status

MatheusChiodi/cockpit

Status line with the reads against the edits of the turn, saying whether Claude is still exploring or already changing code

★ 2Status lineGuards

expo-install-guard

MatheusChiodi/cockpit

Refuses npm, pnpm or yarn installs of packages the Expo SDK pins and names the npx expo install command, and tells Claude to rebuild the dev client after a native one

★ 2ToastsGuards

eye-rest

MatheusChiodi/cockpit

The 20-20-20 rule: every 20 minutes of use, look 20 feet away for 20 seconds

★ 2ToastsGuardsPrompt

failed-commands

MatheusChiodi/cockpit

Reminds Claude of the commands that failed earlier in this session, so it does not retry them blindly

★ 2GuardsPromptAutomation

field-injection-note

MatheusChiodi/cockpit

Tells Claude when a Java edit adds @Autowired or @Inject on a field instead of the constructor

★ 2ToastsGuards

file-churn

MatheusChiodi/cockpit

Toast when the same file is edited six times within half an hour, a sign to step back

★ 2ToastsGuards

file-trail

MatheusChiodi/cockpit

/trail opens a pane with the files read and changed in the session

★ 2PanesGuardsCommands

files-band

MatheusChiodi/cockpit

Fixed band with the files Claude changed in this session

★ 2BandsGuards

fill-toast

MatheusChiodi/cockpit

A toast when the context window jumps 10 points or more in one step, naming the last tool that ran

★ 2ToastsGuards

flatlist-note

MatheusChiodi/cockpit

Tells Claude when an edit renders a mapped list inside a vertical ScrollView, or nests a FlatList in one, in a React Native project

★ 2ToastsGuards