Urgent.News

What's breaking now, across thousands of outlets.

AI

We ran 28 git commands through Claude Code's most-installed git guardrail

The most-installed git skill for Claude Code is git-guardrails-claude-code, Matt Pocock's git safety skill , with 523,036 all-time installs on the skills.sh registry as of November 7, 2026. It lives in mattpocock/skills on GitHub (317,373 stars the same day). It does one job. In the words of its SKILL.md, it "Sets up a PreToolUse hook that intercepts and blocks dangerous git commands before…

The most-installed git safety skill for Claude Code, named git-guardrails-claude-code, has achieved an impressive 523,036 installations as of November 7, 2026. Created by Matt Pocock, this skill resides in the GitHub repository mattpocock/skills, boasting 317,373 stars at the same time. Its purpose is straightforward: intercept and block dangerous git commands before Claude executes them, as outlined in its SKILL.md file.

To achieve this, the skill sets up a PreToolUse hook that intercepts and halts dangerous git commands. While this is more reliable than a rule in CLAUDE.md, because a hook runs on every tool call, its effectiveness relies on the patterns it uses. To test its capabilities, we ran 28 git commands through Claude Code and analyzed the results.

The skill copies block-dangerous-git.sh into either .claude/hooks/ (for a single project) or ~/.claude/hooks/ (for all projects), then registers it under hooks.PreToolUse using a Bash matcher. Upon receiving a shell command, the hook processes it via a JSON payload on stdin. The command string is located at .tool_input.command. If a command matches any of the predefined dangerous patterns, the hook prints an error message to stderr and exits with code 2, which Claude Code then prevents from executing.

The block-dangerous-git.sh script, consisting of just 25 lines, reads the command using jq, loops through a list of dangerous patterns, and runs grep -qE against each entry. If a match is found, the script prints a "BLOCKED" message and exits with code 2. The list of dangerous patterns includes commands like git push, git reset --hard, git clean -fd, git clean -f, git branch -D, git checkout ., git restore ., push --force, reset --hard, and more.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at dev.to →

More in AI

Two coding agents broke each other's code on different laptops. So I built them a control tower on Switch.

A first-timer's guide to Switch, through the project I built for Flip the Switch: Detente, traffic control for coding agents.

  • Two coding agents caused build failures by interfering with each other's code on separate laptops.
  • Team developed Switch control tower on Switch device to prevent conflicts.
  • Detente agent monitors conversations and clears flight plans for coding agents.

I Built an Open-Source Agent Skill to Make AI-Generated Frontends Less Generic

AI coding agents have become incredibly capable at building websites. Tools like Codex and Claude Code can generate components, implement features, fix bugs, and work across entire codebases.

  • Premium Frontend Director is open-source Agent Skill for AI coding agents
  • Enhances AI-generated frontends with creative direction and visual verification
  • Offers Refined, Expressive, and Immersive ambition modes for distinct visual styles

More from Saturday 7 November →