git-guard
by CJ · ★ 0 · updated today
Denies a Bash git command that loses work Claude Code does not already guard: git branch -D, a force push to main or master, and git checkout -- . or git restore . on a dirty tree; each deny names the safe alternative
Install
/plugin marketplace add cpeaustriajc/cj-stack/plugin install git-guard@cj-stackThen run /reload-plugins or start a new session. Requires Claude Code 2.1.287+.
What it hooks into
From an automated scan with claude plugin validate, not a security review. Mods run with your permissions; read the code before installing.
- Events
tool.call- API calls
$.process.run$.session.cwd- Can see
Bash calls- Reach
- level 2 of 3 runs processes
Origin
- How it got here
- Automated scan of public GitHub repos, via the CC0 dataset awesome-claude-code-mods (scan of ).
- Repository
- github.com/cpeaustriajc/cj-stack
- Path in repo
mods/git-guard- Source commit
31b78a7the exact code the scan read- Author
- CJ @cpeaustriajc
- License
- No license declared — ask the author before reusing code.
- First published
- Last pushed
- First listed here
Name and description come from the mod's own manifest. We link to the code; we don't host it, and it stays under its author's license.
More from cpeaustriajc/cj-stack
denial-explainer
cpeaustriajc/cj-stack
Says which rule blocked an action in auto mode and the allow rule that would cover it
hone-nudge
cpeaustriajc/cj-stack
Suggests /hone when you corrected Claude during a cj-stack skill run
kill-guard
cpeaustriajc/cj-stack
Denies a Bash command that stops processes by name or by port, because it can also stop another checkout's dev server; a kill of a named PID passes
linear-gate
cpeaustriajc/cj-stack
Blocks Linear writes off shift; on shift, leaves them to your permission mode and asks only before a delete or cancel.
loop-brake
cpeaustriajc/cj-stack
Ends a turn after N forced Stop-hook continuations so a looping goal hook cannot burn your usage
memory-lint
cpeaustriajc/cj-stack
Denies an auto-memory write that holds task state, one-off references or repo detail, so memory keeps only what is worth relearning
session-modes
cpeaustriajc/cj-stack
/mode readonly, research, prototype and build: a working mode enforced for the whole session
usage-pace
cpeaustriajc/cj-stack
Weekly usage in the status line, and whether it lasts until the reset
work-folder
cpeaustriajc/cj-stack
Denies a new agent working file (plan, evidence, prototype, scratch, report, probe test) outside .claude/work/, which is gitignored, with a per-repo allow list