zcaceres

Claude Git Reset — Git skill for Claude Code

Git community

Claude Code hook to block destructive git commands (reset --hard, force push, etc.

How to install Claude Git Reset

This entry records only its repository, not the path inside it, so there is no exact command to give. Open zcaceres/claude-git-reset and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Git Reset does

Claude Code hook to block destructive git commands (reset --hard, force push, etc.)

Alternatives in Git

  • Ws Reset — Reset the current branch to main, fetch upstream, and update submodules 38.1k ★
  • Worktree Deliver — Commit all work, push, and create a pull request from the current worktree 23.4k ★
  • Yeet — Stage, commit, push code, and open a GitHub pull request via CLI 14.6k ★

README

claude-git-reset — archived

[!IMPORTANT] **Moved to the skills collection:** [`zcaceres/skills`](https://github.com/zcaceres/skills)

New home: [`skills/safety-git-reset-guard`](https://github.com/zcaceres/skills/tree/main/skills/safety-git-reset-guard)

**This repo is archived.** The hook has moved into [`zcaceres/skills`](https://github.com/zcaceres/skills) as the `safety-git-reset-guard` skill, with pre-built binaries (no `bun` runtime dependency on the host) and a self-wiring install script.

New home

  • Skill: `zcaceres/skills/skills/safety-git-reset-guard`
  • Install:
    npx skills add zcaceres/skills -s safety-git-reset-guard -g
    ~/.claude/skills/safety-git-reset-guard/scripts/install.sh
  • The second step wires the PreToolUse:Bash hook into ~/.claude/settings.json with a timestamped backup. Idempotent — re-running is a no-op.

Why the move

This repo shipped a TypeScript hook that required `bun` on every host and a manual settings.json patch. The skills-repo version:

  • Ships pre-built binaries per OS/arch in scripts/bin/, dispatched by scripts/run.sh — no bun install required for end users.
  • Bundles a scripts/install.sh that handles the settings.json wiring idempotently with backups.
  • Lives next to the other safety hooks (safety-rm-rf-guard, safety-dotenv-guard, safety-op-creds) for one consistent install path.

Same blocked / allowed pattern set as documented previously, same caveat: this is one layer of defense, not a sandbox.

Migrating from this repo

If you previously wired the hook from `/path/to/claude-git-reset/src/index.ts`:

  1. Remove that entry from .claude/settings.json (it's a one-line PreToolUse command hook). Keep a backup first.
  2. Run the two install commands above.

The skills-repo install drops a pointer into the same `PreToolUse:Bash` slot.