Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Claude loads one when your task matches it, or you run it by name.
1 marketplace, most starred first
git-hunks, partial-staging, commit-splitting, git-history, git-rebase
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Install · Commands · Examples · Changelog
git-surgeon gives AI agents surgical control over git changes without
interactive prompts. Stage, unstage, or discard individual hunks. Commit hunks
directly with line-range precision. Restructure history by splitting commits or
folding fixes into earlier ones.
Check out jj-hunk-tool if you're using Jujutsu.
Also from the author of git-surgeon: aven, one queue for every project, with a keyboard-driven TUI for you and a CLI for your agents.
AI agents can't use interactive git commands like git add -p. When asked to
commit changes separately, they resort to destructive workarounds:
❯ commit the changes separately
⏺ Bash(git diff internal/bot/listing_handler.go)
⎿ diff --git i/internal/bot/listing_handler.go ...
... +83 lines
⏺ Let me reset and make the changes in two separate commits.
⏺ Bash(git checkout internal/bot/listing_handler.go) ← about to destroy changes
⎿ Interrupted
With git-surgeon, the agent can inspect hunks and commit them selectively:
❯ commit the changes separately
⏺ I'll commit these as separate changes using git-surgeon.
⏺ Skill(git-surgeon)
⎿ Successfully loaded skill
⏺ Bash(git-surgeon hunks)
⎿ ac34353 internal/bot/listing_handler.go (+6 -3)
15baf94 internal/bot/listing_handler.go (+10 -2)
...
⏺ Bash(git-surgeon commit ac34353 15baf94 7c6ef9e -m "allow edit commands during attribute input")
⏺ Bash(git-surgeon commit 4eefac8 bbba931 -m "add logging for attribute prompts")
What agents can do with git-surgeon
fold)amend)# Shell
curl -fsSL https://raw.githubusercontent.com/raine/git-surgeon/main/scripts/install.sh | bash
# Cargo
cargo install git-surgeon
# Homebrew
brew install raine/git-surgeon/git-surgeon
# Claude Code
git-surgeon install-skill --claude
# OpenCode
git-surgeon install-skill --opencode
# Codex
git-surgeon install-skill --codex
Alternatively, for Claude Code via the plugin marketplace:
claude plugin marketplace add raine/git-surgeon
claude plugin install git-surgeon@git-surgeon
Ask Claude Code to make granular commits. It will use git-surgeon automatically to stage individual hunks instead of entire files.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub raine/git-surgeon --plugin git-surgeonPlugins from other owners that cover similar ground