Skip to content
Best Agent Skills
Premium Coding

Git Guardrails skill

Blocks risky git commands before Claude Code can run them.

A Premium skill. Premium opens soon.

By
Matt Pocock
Licence
MIT
Installs
486.9K
Works in
17 apps
No example output yet, so this is the start of the skill’s own instructions.

What Git Guardrails makes

Sets up a safety hook in Claude Code that stops dangerous git commands before they run. When one is blocked, Claude is told it does not have permission to use it.

The blocked list covers pushing (including force pushes), hard resets, forced cleans, force-deleting branches, and commands that throw away all your local edits. You choose whether it applies to one project or to every project, and you can add or remove patterns.

Best for: Claude Code users who want an AI agent to work on a repo without any chance of wiping history.

  • Blocks git push, reset --hard, clean -f, branch -D and checkout .
  • Install for one project or for all projects
  • Ships a ready hook script, then helps you test it
  • Pattern list is easy to customise

Example prompts

Type something like this once the skill is added. Your app opens the skill when the request matches.

  • Set up git guardrails for this project

  • Block force pushes everywhere on my machine

  • Also block git stash drop in my guardrails

  • Test that the git safety hook works

What’s inside

4 files in the skill folder, with its MIT licence kept inside. 1 is a program file your agent can run. Read them before you install.

  • SKILL.md the instructions
  • agents/ 1 files
  • scripts/ 1 files
  • LICENSE licence

Which apps it works in

A skill is a folder of plain files, so any app that reads the open skills format can use it. Pick your app for its page.

How to add Git Guardrails to your app

Step by step for each app. We say where to click, so you never need to leave this page.

ChatGPTby OpenAI
  1. 1 Download the skill (.zip) with the button at the top of this page, then unzip it.
  2. 2 Open the ChatGPT desktop app and look for Skills in the sidebar, where standalone skills are listed.
  3. 3 Add the “git-guardrails-claude-code” folder there if your version offers it. If you do not see Skills yet, use this skill in Claude or Codex instead.
  4. 4 In a chat, type @ and pick the skill, or just ask. Ask for what you want, for example: “Set up git guardrails for this project”

To make your own, describe the workflow to @skill-creator in ChatGPT Work and it drafts a skill for you.

More ChatGPT skills

Claude appby Anthropic
  1. 1 Download the skill (.zip) with the button at the top of this page.
  2. 2 In the Claude app, open Settings > Features.
  3. 3 Upload the .zip file.
  4. 4 Ask for what you want, for example: “Set up git guardrails for this project”

The current Claude Help Center lists Free, Pro, Max, Team and Enterprise. Organization policy can restrict uploads and sharing. Chat runs code in an isolated environment; uploading a skill does not give it your local project, coding-agent tools or unrestricted network access.

More Claude app skills

Codexby OpenAI
  1. 1 Download the skill (.zip) with the button at the top of this page, then unzip it.
  2. 2 Move the “git-guardrails-claude-code” folder into your skills folder:~/.agents/skills
  3. 3 Or paste the install prompt below into Codex and let it do the copying.
  4. 4 Start a new session. Ask for what you want, for example: “Set up git guardrails for this project”

Install prompt: paste this into Codex

I downloaded the agent skill "Git Guardrails" as git-guardrails-claude-code.zip. Unzip it and copy the git-guardrails-claude-code folder into ~/.agents/skills. Before you finish, list every file it contains, show me any scripts and what they do, and stop if anything asks for passwords, API keys or downloads from other websites.

To use the skill in one project only, put it in .agents/skills inside that project instead.

More Codex skills

Claude Codeby Anthropic
  1. 1 Download the skill (.zip) with the button at the top of this page, then unzip it.
  2. 2 Move the “git-guardrails-claude-code” folder into your skills folder:~/.claude/skills
  3. 3 Or paste the install prompt below into Claude Code and let it do the copying.
  4. 4 Start a new session. Ask for what you want, for example: “Set up git guardrails for this project”

Install prompt: paste this into Claude Code

I downloaded the agent skill "Git Guardrails" as git-guardrails-claude-code.zip. Unzip it and copy the git-guardrails-claude-code folder into ~/.claude/skills. Before you finish, list every file it contains, show me any scripts and what they do, and stop if anything asks for passwords, API keys or downloads from other websites.

Built-in installer: claude plugin marketplace add <owner/repo>

Built-in installer: claude plugin install <plugin>@<marketplace>

To use the skill in one project only, put it in .claude/skills inside that project instead.

More Claude Code skills

Cursor
  1. 1 Download the skill (.zip) with the button at the top of this page, then unzip it.
  2. 2 Move the “git-guardrails-claude-code” folder into your skills folder:~/.cursor/skills
  3. 3 Or paste the install prompt below into Cursor and let it do the copying.
  4. 4 Start a new session. Ask for what you want, for example: “Set up git guardrails for this project”

Install prompt: paste this into Cursor

I downloaded the agent skill "Git Guardrails" as git-guardrails-claude-code.zip. Unzip it and copy the git-guardrails-claude-code folder into ~/.cursor/skills. Before you finish, list every file it contains, show me any scripts and what they do, and stop if anything asks for passwords, API keys or downloads from other websites.

To use the skill in one project only, put it in .cursor/skills inside that project instead. Cursor also reads ~/.agents/skills, ~/.claude/skills, ~/.codex/skills.

More Cursor skills

GitHub Copilotby GitHub
  1. 1 Download the skill (.zip) with the button at the top of this page, then unzip it.
  2. 2 Move the “git-guardrails-claude-code” folder into your skills folder:~/.copilot/skills
  3. 3 Or paste the install prompt below into GitHub Copilot and let it do the copying.
  4. 4 Start a new session. Ask for what you want, for example: “Set up git guardrails for this project”

Install prompt: paste this into GitHub Copilot

I downloaded the agent skill "Git Guardrails" as git-guardrails-claude-code.zip. Unzip it and copy the git-guardrails-claude-code folder into ~/.copilot/skills. Before you finish, list every file it contains, show me any scripts and what they do, and stop if anything asks for passwords, API keys or downloads from other websites.

Built-in installer: gh skill install <owner/repo> <skill> --agent github-copilot --scope user

To use the skill in one project only, put it in .github/skills inside that project instead. GitHub Copilot also reads ~/.agents/skills.

More GitHub Copilot skills

Gemini CLIby Google
  1. 1 Download the skill (.zip) with the button at the top of this page, then unzip it.
  2. 2 Move the “git-guardrails-claude-code” folder into your skills folder:~/.gemini/skills
  3. 3 Or paste the install prompt below into Gemini CLI and let it do the copying.
  4. 4 Start a new session. Ask for what you want, for example: “Set up git guardrails for this project”

Install prompt: paste this into Gemini CLI

I downloaded the agent skill "Git Guardrails" as git-guardrails-claude-code.zip. Unzip it and copy the git-guardrails-claude-code folder into ~/.gemini/skills. Before you finish, list every file it contains, show me any scripts and what they do, and stop if anything asks for passwords, API keys or downloads from other websites.

Built-in installer: gemini skills install <git-url>

To use the skill in one project only, put it in .gemini/skills inside that project instead. Gemini CLI also reads ~/.agents/skills.

More Gemini CLI skills

Windsurf
  1. 1 Download the skill (.zip) with the button at the top of this page, then unzip it.
  2. 2 Move the “git-guardrails-claude-code” folder into your skills folder:~/.codeium/windsurf/skills
  3. 3 Or paste the install prompt below into Windsurf and let it do the copying.
  4. 4 Start a new session. Ask for what you want, for example: “Set up git guardrails for this project”

Install prompt: paste this into Windsurf

I downloaded the agent skill "Git Guardrails" as git-guardrails-claude-code.zip. Unzip it and copy the git-guardrails-claude-code folder into ~/.codeium/windsurf/skills. Before you finish, list every file it contains, show me any scripts and what they do, and stop if anything asks for passwords, API keys or downloads from other websites.

To use the skill in one project only, put it in .windsurf/skills inside that project instead.

More Windsurf skills

Kiro
  1. 1 Download the skill (.zip) with the button at the top of this page, then unzip it.
  2. 2 Move the “git-guardrails-claude-code” folder into your skills folder:~/.kiro/skills
  3. 3 Or paste the install prompt below into Kiro and let it do the copying.
  4. 4 Start a new session. Ask for what you want, for example: “Set up git guardrails for this project”

Install prompt: paste this into Kiro

I downloaded the agent skill "Git Guardrails" as git-guardrails-claude-code.zip. Unzip it and copy the git-guardrails-claude-code folder into ~/.kiro/skills. Before you finish, list every file it contains, show me any scripts and what they do, and stop if anything asks for passwords, API keys or downloads from other websites.

To use the skill in one project only, put it in .kiro/skills inside that project instead.

More Kiro skills

Antigravityby Google
  1. 1 Download the skill (.zip) with the button at the top of this page, then unzip it.
  2. 2 Move the “git-guardrails-claude-code” folder into your skills folder:~/.gemini/antigravity/skills
  3. 3 Or paste the install prompt below into Antigravity and let it do the copying.
  4. 4 Start a new session. Ask for what you want, for example: “Set up git guardrails for this project”

Install prompt: paste this into Antigravity

I downloaded the agent skill "Git Guardrails" as git-guardrails-claude-code.zip. Unzip it and copy the git-guardrails-claude-code folder into ~/.gemini/antigravity/skills. Before you finish, list every file it contains, show me any scripts and what they do, and stop if anything asks for passwords, API keys or downloads from other websites.

To use the skill in one project only, put it in .agents/skills inside that project instead.

More Antigravity skills

OpenCode
  1. 1 Download the skill (.zip) with the button at the top of this page, then unzip it.
  2. 2 Move the “git-guardrails-claude-code” folder into your skills folder:~/.config/opencode/skills
  3. 3 Or paste the install prompt below into OpenCode and let it do the copying.
  4. 4 Start a new session. Ask for what you want, for example: “Set up git guardrails for this project”

Install prompt: paste this into OpenCode

I downloaded the agent skill "Git Guardrails" as git-guardrails-claude-code.zip. Unzip it and copy the git-guardrails-claude-code folder into ~/.config/opencode/skills. Before you finish, list every file it contains, show me any scripts and what they do, and stop if anything asks for passwords, API keys or downloads from other websites.

To use the skill in one project only, put it in .opencode/skills inside that project instead. OpenCode also reads ~/.agents/skills, ~/.claude/skills.

More OpenCode skills

Cline
  1. 1 Download the skill (.zip) with the button at the top of this page, then unzip it.
  2. 2 Move the “git-guardrails-claude-code” folder into your skills folder:~/.agents/skills
  3. 3 Or paste the install prompt below into Cline and let it do the copying.
  4. 4 Start a new session. Ask for what you want, for example: “Set up git guardrails for this project”

Install prompt: paste this into Cline

I downloaded the agent skill "Git Guardrails" as git-guardrails-claude-code.zip. Unzip it and copy the git-guardrails-claude-code folder into ~/.agents/skills. Before you finish, list every file it contains, show me any scripts and what they do, and stop if anything asks for passwords, API keys or downloads from other websites.

To use the skill in one project only, put it in .agents/skills inside that project instead.

More Cline skills

Amp
  1. 1 Download the skill (.zip) with the button at the top of this page, then unzip it.
  2. 2 Move the “git-guardrails-claude-code” folder into your skills folder:~/.config/agents/skills
  3. 3 Or paste the install prompt below into Amp and let it do the copying.
  4. 4 Start a new session. Ask for what you want, for example: “Set up git guardrails for this project”

Install prompt: paste this into Amp

I downloaded the agent skill "Git Guardrails" as git-guardrails-claude-code.zip. Unzip it and copy the git-guardrails-claude-code folder into ~/.config/agents/skills. Before you finish, list every file it contains, show me any scripts and what they do, and stop if anything asks for passwords, API keys or downloads from other websites.

Built-in installer: amp skill add <github-url> --global

To use the skill in one project only, put it in .agents/skills inside that project instead. Amp also reads ~/.agents/skills, ~/.config/amp/skills, ~/.claude/skills.

More Amp skills

Gooseby Block
  1. 1 Download the skill (.zip) with the button at the top of this page, then unzip it.
  2. 2 Move the “git-guardrails-claude-code” folder into your skills folder:~/.agents/skills
  3. 3 Or paste the install prompt below into Goose and let it do the copying.
  4. 4 Start a new session. Ask for what you want, for example: “Set up git guardrails for this project”

Install prompt: paste this into Goose

I downloaded the agent skill "Git Guardrails" as git-guardrails-claude-code.zip. Unzip it and copy the git-guardrails-claude-code folder into ~/.agents/skills. Before you finish, list every file it contains, show me any scripts and what they do, and stop if anything asks for passwords, API keys or downloads from other websites.

To use the skill in one project only, put it in .agents/skills inside that project instead. Goose also reads ~/.claude/skills.

More Goose skills

OpenClaw
  1. 1 Download the skill (.zip) with the button at the top of this page, then unzip it.
  2. 2 Move the “git-guardrails-claude-code” folder into your skills folder:~/.openclaw/skills
  3. 3 Or paste the install prompt below into OpenClaw and let it do the copying.
  4. 4 Start a new session. Ask for what you want, for example: “Set up git guardrails for this project”

Install prompt: paste this into OpenClaw

I downloaded the agent skill "Git Guardrails" as git-guardrails-claude-code.zip. Unzip it and copy the git-guardrails-claude-code folder into ~/.openclaw/skills. Before you finish, list every file it contains, show me any scripts and what they do, and stop if anything asks for passwords, API keys or downloads from other websites.

Built-in installer: openclaw skills install @owner/<slug>

Built-in installer: openclaw skills install @owner/<slug> --global

Built-in installer: openclaw skills install git:owner/repo@ref

To use the skill in one project only, put it in skills inside that project instead. OpenClaw also reads ~/.agents/skills.

More OpenClaw skills

Hermes Agentby Nous Research
  1. 1 Download the skill (.zip) with the button at the top of this page, then unzip it.
  2. 2 Move the “git-guardrails-claude-code” folder into your skills folder:~/.hermes/skills
  3. 3 Or paste the install prompt below into Hermes Agent and let it do the copying.
  4. 4 Start a new session. Ask for what you want, for example: “Set up git guardrails for this project”

Install prompt: paste this into Hermes Agent

I downloaded the agent skill "Git Guardrails" as git-guardrails-claude-code.zip. Unzip it and copy the git-guardrails-claude-code folder into ~/.hermes/skills. Before you finish, list every file it contains, show me any scripts and what they do, and stop if anything asks for passwords, API keys or downloads from other websites.

Built-in installer: hermes skills install <owner/repo/skill>

More Hermes Agent skills

VS Codeby Microsoft
  1. 1 Download the skill (.zip) with the button at the top of this page, then unzip it.
  2. 2 Move the “git-guardrails-claude-code” folder into your skills folder:~/.copilot/skills
  3. 3 Or paste the install prompt below into VS Code and let it do the copying.
  4. 4 Start a new session. Ask for what you want, for example: “Set up git guardrails for this project”

Install prompt: paste this into VS Code

I downloaded the agent skill "Git Guardrails" as git-guardrails-claude-code.zip. Unzip it and copy the git-guardrails-claude-code folder into ~/.copilot/skills. Before you finish, list every file it contains, show me any scripts and what they do, and stop if anything asks for passwords, API keys or downloads from other websites.

To use the skill in one project only, put it in .github/skills inside that project instead. VS Code also reads ~/.claude/skills, ~/.agents/skills.

More VS Code skills

This skill includes 1 program file. That is normal for skills that build real files, but read them first, and stop if anything asks for passwords or outside downloads.

Questions about Git Guardrails

Which tool is this for?

Claude Code. It uses Claude Code hooks, so it does not apply to other agents.

Can I change what is blocked?

Yes. After installing, the skill asks if you want to add or remove patterns and edits the script for you.

Is the Git Guardrails skill free?

It is a Premium skill on Best Agent Skills. Premium opens soon, with monthly, yearly and lifetime plans on the pricing page.

Who made the Git Guardrails skill?

Matt Pocock. We did not write it. Best Agent Skills curates skills like this one, explains them in plain words and shows how to add them to your app. It is shared under the MIT licence (Copyright (c) 2026 Matt Pocock).

Browse all skills