
git-guardrails-claude-code
设置 Claude Code hooks,在危险 git commands(push、reset --hard、clean、branch -D
by vinvcnFree
Description
git-guardrails-claude-code is an agent skill from the vinvcn/mattpocock-skills-zh-cn repository, listed on skills.sh. It sets up a PreToolUse hook in Claude Code that intercepts and blocks dangerous git commands before they run. The blocked commands are git push, including with force, git reset --hard, git clean with force flags, git branch -D, and git checkout or restore on the whole working tree. When a command is blocked, Claude sees a message saying it does not have permission to use that command. The skill's setup asks first whether to install the hook for the current project only, in the project settings file, or for all projects, in the user settings file, and then writes the configuration. It is meant for users who want to prevent destructive git operations, add git safety hooks, or stop git push and reset inside Claude Code. The skill is written in Chinese and is part of a Chinese translation of Matt Pocock's skills collection. The listing shows it as free, and its audits all show Pass results.…
Highlights
- Blocks git push, reset --hard and clean -f
- Blocks branch deletion and whole-tree checkout
- Project-only or all-projects install
- Uses a Claude Code PreToolUse hook
Ratings & Reviews
No ratings yet
Be the first to rate git-guardrails-claude-code.
People also visit

code-review-expert
Expert code review of current git changes with a senior engineer lens
git-guardrails-claude-code FAQ
What does git-guardrails-claude-code do?
It sets up a Claude Code hook that blocks dangerous git commands before they run.
How do I install it?
Run: npx skills add https://github.com/vinvcn/mattpocock-skills-zh-cn --skill git-guardrails-claude-code
Which commands are blocked?
git push including force, git reset --hard, git clean -f or -fd, git branch -D, and git checkout or restore on the whole tree.
Can I install it for one project only?
Yes. The skill asks whether to install it for the current project or for all projects.
What does Claude see when a command is blocked?
A message saying it does not have permission to use that command.
What do the security audits say?
Gen Agent Trust Hub: Pass. Socket: Pass. Snyk: Pass.
What are the best git-guardrails-claude-code alternatives?
Popular alternatives to git-guardrails-claude-code include git-guardrails-claude-code, Claude Code Safety Net and safety-hooks. See all git-guardrails-claude-code alternatives
















