# git-history-hygiene

> Clean up messy branch history before review or merge.

git-history-hygiene is a paid AI agent skill on Agensi by StarNose, in DevOps & Cloud. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $5 (one-time purchase)
- Creator: [StarNose](https://www.agensi.io/creators/starnose)
- Category: [DevOps & Cloud](https://www.agensi.io/skills/devops-cloud)
- Version: 0.1.0
- Last updated: 2026-10-17
- Security: scan passed (2026-10-17); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/git-history-hygiene
- Tags: devops, code-review

## About this skill

Turn a 47-commit "WIP / fix / oops" feature branch into a reviewable sequence of
well-named commits before it reaches a pull request. This skill is a
discipline-driven playbook built entirely on the real git CLI: audit the branch,
classify every commit, rewrite with interactive rebase, and verify the rewrite
against a backup ref before pushing.

A messy commit history makes code review slow, blame archaeology painful, and
`git bisect` useless. Git History Hygiene gives you a repeatable, safety-first
workflow for rewriting a feature branch's history — squashing fixups, dropping
dead ends, rewording messages — so the merged history tells the story of the
change, not the story of how you fumbled through it.

- Before opening a pull request, when your feature branch has accumulated
  WIP commits, typo fixes, reverted experiments, and merge-noise.
- When a reviewer asks for a "clean history" on an existing PR.
- When you inherit a branch with dozens of commits and need to make it
  reviewable without losing any actual changes.
- Before merging a long-lived feature branch that contains debugging
  commits, commented-out code, or "trying again" commits.

- **Never on `main`, `master`, `develop`, release branches, or any branch
  other people build on.** Rewriting shared history is destructive and
  cannot be fully undone for collaborators.
- When the branch is already merged (rewrite the follow-up instead).
- When the PR is about to be squash-merged anyway — the platform will
  produce one clean commit and history cleanup adds nothing.
- When commits contain secrets or large binaries that must be purged from
  history entirely — that is a `git filter-repo` incident-response job,
  not history hygiene (see Limitations).
- When you are unsure whether anyone else is working from your branch —
  confirm first, rewrite second.

## Requires

- Git

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the git-history-hygiene skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What does git-history-hygiene do?

Clean up messy branch history before review or merge.

### Which AI agents support git-history-hygiene?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use git-history-hygiene?

Connect your AI agent to Agensi through MCP, then ask it to use git-history-hygiene on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
