{
  "id": 18744981,
  "title": "We ran 28 git commands through Claude Code's most-installed git guardrail",
  "url": "https://urgent.news/2026/11/07/we-ran-28-git-commands-through-claude-codes-most-installed-git",
  "topic": "ai",
  "section": "AI",
  "published": "2026-11-07T16:24:13.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/skillselion/we-ran-28-git-commands-through-claude-codes-most-installed-git-guardrail-1n4i"
  },
  "original_language": "en",
  "account": "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.\n\nTo 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.\n\nThe 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.\n\nThe 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.",
  "summary": "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…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 2,
    "also_reported_by": [
      {
        "outlet": "XDA Developers",
        "title": "Someone used Claude Code to reverse-engineer the Apple AirPods 3, and now head-tracking works on Linux",
        "url": "https://urgent.news/2026/11/06/someone-used-claude-code-to-reverse-engineer-the-apple-airpods-3-and",
        "published": "2026-11-06T08:36:56.000Z"
      }
    ]
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}