Claude Code mod

branch-guard

Asks the user before Edit/Write/NotebookEdit changes a file of a git repo whose current branch is main or master (once per repo and session)

Git & GitHub modsValidates on Claude Code 2.1.316 Source

Install

From source
git clone https://github.com/vincentlauriat/ModsTools.git
claude --plugin-dir ./ModsTools/mods/branch-guard

The repo has no marketplace file, so load the plugin folder directly with --plugin-dir.

What it can access

Reach
L2Writes or runs: runs processes, reads files, reads mod state, draws
Sees
Edit calls, Write calls, NotebookEdit calls
Hooks
session.startcommand.runtool.checktool.call

From a static scan of the mod's code by awesome-claude-code-mods. It shows what the code asks for, not a security review.

How Claude Code mods work

  • A mod is a plugin with a JavaScript or TypeScript module that runs inside Claude Code (version 2.1.287 or later). It can draw panes beside the transcript, a band above the prompt, buttons and toasts, restyle the spinner and tool rows, and watch or rewrite tool calls and prompts.
  • It installs like any plugin: add its marketplace with /plugin marketplace add owner/repo, then /plugin install name@marketplace.
  • Check what a mod can reach before installing: it runs with your permissions. Reach goes from drawing only, to reading files, to writing files or running processes, to the network. Run claude plugin validate on a clone to list its hooks and calls without running it.
  • Turn one off from the Installed tab in /plugin, or start Claude Code with --safe-mode to skip every customization for a session.
Claude Code docs

Details

Folder
mods/branch-guard
Author
Vincent Lauriat
License
MIT
Last updated
5 October 2026

FAQ

What is branch-guard?

Asks the user before Edit/Write/NotebookEdit changes a file of a git repo whose current branch is main or master (once per repo and session) It is a mod for Claude Code, from vincentlauriat/ModsTools on GitHub.

What can the branch-guard mod access?

Its widest reach is "writes or runs" (runs processes, reads files, reads mod state, draws). It sees Edit calls, Write calls, NotebookEdit calls. Like any mod, it runs with your permissions.

How do I install branch-guard?

Clone vincentlauriat/ModsTools and start Claude Code with --plugin-dir pointing at the mod's folder (mods/branch-guard).

More git & github mods

Browse the most popular Claude Code mods, all git & github mods, or the skills and MCP server directories.