What is branch-guard?
branch-guard is a Claude Code mod by vincentlauriat that 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 listed under Security and has no public popularity data yet.
| Type | Claude code mod |
|---|---|
| Author | vincentlauriat |
| Repository | vincentlauriat/ModsTools |
| Popularity | no public popularity data yet |
| Category | Security |
| Security | Low risk (88/100) |
| Rank | #5,019 of 5,272 Claude Code mods; #516 in Security |
| License | MIT |
| Last commit | 2026-10-05 |
| Hooks | 4 events |
| Sees | Edit calls, NotebookEdit calls, Write calls |
| Draws on | nothing |
Is branch-guard safe to install?
branch-guard scores 88/100 on the MCPMods security check: Low risk. Things to review: starts processes outside the sandbox. It passed 7 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.
| Check | Result |
|---|---|
| No network access | Pass |
| Starts processes outside the sandbox | Review |
| Writes no files or config | Pass |
| Doesn't read environment variables | Pass |
| Only sees the events it hooks | Pass |
| Doesn't drive Claude | Pass |
| Passes claude plugin validate | Pass |
| Has an open-source license | Pass |
API calls in its code
| Call | What it means |
|---|---|
$.clock.now | |
$.command.register | |
$.fs.exists | reads files |
$.process.run | runs processes |
$.session.cwd | |
$.state.get | |
$.state.set | |
$.ui.status | draws interface |
How do I install branch-guard?
- Check your Claude Code version. Mods need Claude Code 2.1.287 or later and are on by default.
claude --version
- Read its footprint. This lists every event it hooks and every API call it makes, without running it.
git clone https://github.com/vincentlauriat/ModsTools claude plugin validate ./ModsTools/mods/branch-guard
- Install it. Run this in your terminal, then /reload-plugins in an open session.
git clone https://github.com/vincentlauriat/ModsTools && claude --plugin-dir ./ModsTools/mods/branch-guard
Or ask Claude to set it up
Paste this into Claude Code and it installs branch-guard for you:
Install the "branch-guard" Claude Code mod from https://github.com/vincentlauriat/ModsTools/tree/main/mods/branch-guard. Run claude plugin validate on it first and show me what it can access before you enable it.
More from vincentlauriat/ModsTools
This repository has at least 9 Claude Code mods on MCPMods.
- achievement: Playful badges unlocked once ever from real events (tool calls, turns, subagents, tests, git); /achievements lists them (Low risk)
- agent-tracker: A pane listing the subagents launched this session with their status and duration (Low risk)
- ascii-weather: Weather from wttr.in in the status line (refreshed at most once an hour); /weather shows the one-line forecast (Low risk)
- auto-context: Adds git branch, dirty count, last commit and next TODOS to the session's system prompt (Low risk)
- build-gate: Band above the prompt when a turn changed source code without running a matching build or type-check (Low risk)
- changed-files: A pane listing the files Claude modified during the session (Low risk)
- ci-watch: Follows the GitHub Actions runs of a commit after git push: status line while they run, toast with the failed workflows (Low risk)
- command-history: A pane listing the Bash commands run this session with exit status and duration (Low risk)