git-guard

by CJ · ★ 0 · updated today

GuardsAutomationvalidates

0

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 git-guard

Install

/plugin marketplace add cpeaustriajc/cj-stack
/plugin install git-guard@cj-stack

Then run /reload-plugins or start a new session. Requires Claude Code 2.1.287+.

View source on GitHub

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
31b78a7 the 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

★ 0Toasts

hone-nudge

cpeaustriajc/cj-stack

Suggests /hone when you corrected Claude during a cj-stack skill run

★ 0Automation

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

★ 0Guards

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.

★ 0ReskinsGuards

loop-brake

cpeaustriajc/cj-stack

Ends a turn after N forced Stop-hook continuations so a looping goal hook cannot burn your usage

★ 0Status linePrompt

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

★ 0Guards

session-modes

cpeaustriajc/cj-stack

/mode readonly, research, prototype and build: a working mode enforced for the whole session

★ 0BandsGuardsCommands

usage-pace

cpeaustriajc/cj-stack

Weekly usage in the status line, and whether it lasts until the reset

★ 0Status line

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

★ 0Guards