Available

Git AI Toolkit

The working tools from the Git After NASA video series: guardrails that stop AI agents from running destructive git commands, a bisect runner that finds the commit that broke your project, and a one-command setup for running agents in parallel worktrees.

Sign up for Premium to download Included with Premium.
Released
Sep 21, 2026
Size
15 KB

The work­ing tools from the Git After NASA video series: guardrails that stop AI agents from run­ning destruc­tive git com­mands, a bisect run­ner that finds the com­mit that broke your project, and a one-com­mand set­up for run­ning agents in par­al­lel worktrees.

What’s in the box #

ToolWhat it doesEpisode
guardrails/hooks/git-guard.shClaude Code Pre­Too­lUse hook. Blocks force push­es, reset --hard, his­to­ry rewrites, work­ing-tree wipes, stash drops, --no-verify, and shell edits to .claude/ or .git/hooks.2 and 5
guardrails/hooks/protect-config.shBlocks Claude Code’s Edit and Write tools from chang­ing .claude/ or .git/. Guardrail changes stay human-only.5
guardrails/settings.jsonWires both hooks into Claude Code.2 and 5
guardrails/ci/guard-check.ymlGitHub Actions job that fails any pull request where the guards stop block­ing what they should.5
bisect/bisect-smoke.shOra­cle for git bisect run using a Play­wright smoke suite. Clears frame­work caches, resets a dis­pos­able data­base, skips untestable commits.3
worktree/new-worktree.shCre­ates a work­tree with its own branch, .env, data­base, port, and depen­den­cies. Lar­avel + SQLite.4
docs/CLAUDE.md.snippetThe com­mit con­tract and git rules to paste into your project’s CLAUDE​.md.3
docs/WORKFLOW.mdThe fea­ture branch work­flow, rewrit­ten for agents.4
tests/test-guards.shChecks every guard rule with fake tool calls.2 and 5

Install #

From inside your project:

/path/to/git-after-nasa-toolkit-1.0.0/install.sh all

Or pick com­po­nents: guardrails, bisect, worktree. The installer nev­er over­writes an exist­ing file; any­thing it skips is list­ed so you can merge by hand. If your project already has a .claude/settings.json, merge the hooks block from guardrails/settings.json into it.

Then com­mit what it added. The point is that the guardrails live in the repos­i­to­ry, so every clone and every agent gets them.

Ver­i­fy #

HOOK_DIR=.claude/hooks /path/to/git-after-nasa-toolkit-1.0.0/tests/test-guards.sh

Every line should pass. Turn on branch pro­tec­tion for main in your git host (require pull requests, require the guard-check sta­tus, block force push­es) to com­plete the third layer.

Require­ments #

  • Guardrails: Claude Code, bash, and jq or python3. If nei­ther is found the hooks block every­thing rather than fail­ing open.
  • Bisect: Play­wright with a smoke con­fig (default playwright.smoke.config.ts), the app already run­ning at BASE_URL (default http://localhost:8000). Works with any stack; Lar­avel and Craft caches are detect­ed and cleared automatically.
  • Work­tree and fresh-db: Lar­avel with SQLite and a com­mit­ted database/seed.sqlite. The shape car­ries to oth­er stacks, but these two scripts are writ­ten for that one.

Things that will bite you #

  • Exit 2 blocks, exit 1 does not. If you edit the hooks, keep that straight.
  • Claude Code loads hooks and CLAUDE​.md when a ses­sion starts. Start a new ses­sion after chang­ing either.
  • The bisect good ref must be a pass­ing com­mit where the fea­ture already exists. Bisect finds regres­sions, not the com­mit where a fea­ture was born.
  • The bisect script has to exist at every com­mit in the range. If it doesn’t, copy it out first: cp bin/bisect-smoke.sh /tmp/ && git bisect run /tmp/bisect-smoke.sh.
  • The guards match text. Cre­ative quot­ing can get around them, which is why the CI check and branch pro­tec­tion exist. The hooks gate the agent’s tools, not your edi­tor; you can always change the guardrails yourself.

The mod­el #

Three lay­ers. CLAUDE​.md is a sug­ges­tion the agent fol­lows most of the time. The hooks are a con­tract that runs on every tool call. Branch pro­tec­tion and the CI check are the back­stop that doesn’t care what hap­pened on anyone’s laptop.

Ver­sion­ing #

Seman­tic ver­sion­ing. Patch releas­es fix pat­terns or bugs. Minor releas­es add rules or tools. Major releas­es change file lay­out, set­tings shape, or any­thing that needs you to redo an install. See CHANGEL​OG​.md.