git-guard

git-guard is a Claude Code mod by cpeaustriajc that 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.

Updated 2026-10-18

What is git-guard?

git-guard is a Claude Code mod by cpeaustriajc that 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. It is listed under Security and has no public popularity data yet.

TypeClaude code mod
Authorcpeaustriajc
Repositorycpeaustriajc/cj-stack
Popularityno public popularity data yet
CategorySecurity
SecurityLow risk (84/100)
Rank#2,946 of 5,272 Claude Code mods; #338 in Security
Last commit2026-10-18
Hooks1 events
SeesBash calls
Draws onnothing

Is git-guard safe to install?

git-guard scores 84/100 on the MCPMods security check: Low risk. Things to review: starts processes outside the sandbox. It passed 6 of 8 checks.

Mod footprints come from claude plugin validate, which lists every event a mod hooks and every API call it makes without running it.

CheckResult
No network accessPass
Starts processes outside the sandboxReview
Writes no files or configPass
Doesn't read environment variablesPass
Only sees the events it hooksPass
Doesn't drive ClaudePass
Passes claude plugin validatePass
No license detectedNote

API calls in its code

CallWhat it means
$.process.runruns processes
$.session.cwd

How do I install git-guard?

  1. Check your Claude Code version. Mods need Claude Code 2.1.287 or later and are on by default.
    claude --version
  2. Read its footprint. This lists every event it hooks and every API call it makes, without running it.
    git clone https://github.com/cpeaustriajc/cj-stack
    claude plugin validate ./cj-stack/mods/git-guard
  3. Install it. Run this in your terminal, then /reload-plugins in an open session.
    claude plugin marketplace add cpeaustriajc/cj-stack && claude plugin install git-guard@cj-stack

Or ask Claude to set it up

Paste this into Claude Code and it installs git-guard for you:

Install the "git-guard" Claude Code mod from https://github.com/cpeaustriajc/cj-stack/tree/main/mods/git-guard. Run claude plugin validate on it first and show me what it can access before you enable it.

More from cpeaustriajc/cj-stack

This repository has at least 9 Claude Code mods on MCPMods.

  • denial-explainer: Says which rule blocked an action in auto mode and the allow rule that would cover it (Low risk)
  • work-pane: Shows test runs in a pane. (Low risk)
  • bash-trim: Cuts a long successful Bash output to its first 2,000 and last 3,000 characters with a count of the cut lines; read-like (Low risk)
  • hone-nudge: Suggests /hone when you corrected Claude during a cj-stack skill run (Review before installing)
  • kill-guard: Denies a Bash command that stops processes by name or by port, because it can also stop another checkout's dev server; a (Low risk)
  • linear-gate: Blocks Linear writes off shift; on shift, leaves them to your permission mode and asks only before a delete or cancel. (Low risk)
  • loop-brake: Ends a turn after N forced Stop-hook continuations so a looping goal hook cannot burn your usage (High risk)
  • memory-lint: Denies an auto-memory write that holds task state, one-off references or repo detail, so memory keeps only what is worth (Low risk)