What is main-guard?
main-guard is a Claude Code mod by ShriD5 that a red band when you are on main or in prod, and no force-push, reset --hard or unconfirmed push to a protected branch. It is listed under Security and has 1 GitHub stars.
| Type | Claude code mod |
|---|---|
| Author | ShriD5 |
| Repository | ShriD5/claude-mods |
| Popularity | 1 GitHub stars |
| Category | Security |
| Security | Review before installing (76/100) |
| Rank | #2,301 of 5,272 Claude Code mods; #274 in Security |
| License | MIT |
| Last commit | 2026-10-04 |
| Hooks | 3 events |
| Sees | Bash calls |
| Draws on | AbovePrompt |
Is main-guard safe to install?
main-guard scores 76/100 on the MCPMods security check: Review before installing. Things to review: starts processes outside the sandbox; reads environment variables. 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.
| Check | Result |
|---|---|
| No network access | Pass |
| Starts processes outside the sandbox | Review |
| Writes no files or config | Pass |
| Reads environment variables | Review |
| 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.every | |
$.env.get | reads env vars |
$.fs.exists | reads files |
$.process.run | runs processes |
$.session.cwd | |
$.state.get | |
$.state.set | |
$.ui.ask | draws interface |
$.ui.resolve | draws interface |
How do I install main-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/ShriD5/claude-mods claude plugin validate ./claude-mods/main-guard
- Install it. Run this in your terminal, then /reload-plugins in an open session.
git clone https://github.com/ShriD5/claude-mods && claude --plugin-dir ./claude-mods/main-guard
Or ask Claude to set it up
Paste this into Claude Code and it installs main-guard for you:
Install the "main-guard" Claude Code mod from https://github.com/ShriD5/claude-mods/tree/main/main-guard. Run claude plugin validate on it first and show me what it can access before you enable it.
More from ShriD5/claude-mods
This repository has at least 9 Claude Code mods on MCPMods.
- chai-meter: A taxi meter for the session's cost in the status line, in dollars and cups of chai. (Low risk)
- commit-coach: Rewrites lazy commit subjects into conventional commits from the staged diff, and strips AI attribution trailers (Low risk)
- night-mode: Late at night Claude gets more careful and asks before deploys, force pushes and rm -rf (Review before installing)
- phone-approve: Approve or deny Claude Code's permission prompts from Telegram, with the terminal prompt as the fallback. (Low risk)
- rubber-duck: A fast second opinion on every edit: a small model flags removed error handling, deleted tests, secrets and more (Low risk)
- secret-guard: Stops Claude from writing API keys, tokens, private keys and database passwords into files. (Low risk)
- ship-log: /ship turns what you built this session into a build-in-public post for X or LinkedIn (Review before installing)
- standup: /standup writes yesterday's standup (since Friday on Mondays) from your git commits and copies it (Review before installing)