Agent skill

Git History Cleaner

by nixified-ai in nixified-ai/flake

Cleans up git commit history by rebasing and combining commits that edit the same files or logical units, ensuring each logical change is isolated to a single commit.

AGPL-3.0Auto-check passedDevelopment

Install Git History Cleaner

skills CLI
$ npx skills add nixified-ai/flake --skill git-history-cleaner -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install nixified-ai/flake git-history-cleaner --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/nixified-ai/flake.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/git-history-cleaner .claude/skills/git-history-cleaner && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
git-history-cleaner
GitHub stars
841
Token cost
~876 tokens
SKILL.md length
457 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Cleans up git commit history by rebasing and combining commits that edit the same files or logical units, ensuring each logical change is isolated to a single commit.

  • Works in 5 steps: Analyze Commit History → Group Changes by Logical Units → Rebase and Combine Commits → …
  • Tasks that involve Git workflow
  • Calls git
  • Tasks that involve Commit messages

What it does

Git History Cleaner is an agent skill from nixified-ai/flake. Cleans up git commit history by rebasing and combining commits that edit the same files or logical units, ensuring each logical change is isolated to a single commit.

Its SKILL.md is about 880 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Git workflow and Commit messages. It works with Git. The repository describes itself as: A Nix flake for many AI projects. The licence is AGPL-3.0.

When your agent uses it

  • Tasks that involve Git workflow
  • Tasks that involve Commit messages

Example prompts

  • “Use the git-history-cleaner skill to clean up git commit history by rebasing and combining commits that edit the same files or logical units…”
  • “/git-history-cleaner”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Analyze Commit History
  2. Group Changes by Logical Units
  3. Rebase and Combine Commits
  4. Verify the Rebased History
  5. Update Branch Pointer

What it can do on your machine

Read from SKILL.md and the folder at commit b816d1e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Git History Cleaner loads about 876 tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 457 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~47
When it runs · the whole SKILL.md, loaded when a task matches
~876

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from nixified-ai/flake at commit b816d1e, republished under its AGPL-3.0 licence (© nixified-ai). 457 words, ~876 tokens.

Download SKILL.mdSave it as .claude/skills/git-history-cleaner/SKILL.md (or your agent's skills folder).
name
git-history-cleaner
description
Cleans up git commit history by rebasing and combining commits that edit the same files or logical units, ensuring each logical change is isolated to a single commit.

Git History Cleaner

This skill provides a procedural workflow and strategies for cleaning up git commit history. It details how to reorganize, reorder, and combine (squash or fixup) commits to achieve a clean history where each file, feature, or logical unit is introduced/modified in a single self-contained commit.

Workflow

  1. Analyze Commit History:

    • Identify the base commit (e.g., origin/main, master, or a specific hash where the branch diverged) and the current branch HEAD.
    • View the commit messages in reverse chronological order: git log <base>..HEAD --oneline
    • List files modified in each commit: git log <base>..HEAD --name-status
  2. Group Changes by Logical Units:

    • Map files to their logical units (e.g., a specific module, script, library, or config).
    • Identify "fixup" commits (commits fixing errors or formatting in files that were introduced or modified in earlier commits on the branch).
    • Plan the squashing order: each logical unit or file set should be introduced in a single commit, incorporating all subsequent fixes to those same files.
  3. Rebase and Combine Commits:

    • Method A: Interactive Rebase (For straightforward rebases):

      • Run git rebase -i <base>.
      • In the todo list, reorder commits so that any fixup/update commits are positioned immediately below the commit that originally introduced those changes.
      • Change the action of the fixup commits from pick to fixup (or f) to merge them into the parent commit without changing the original commit message, or squash (or s) to combine their commit messages.
    • Method B: Programmatic Rebase Script (For complex histories or index files):

      • If commits frequently modify shared index files (e.g., JSON registries, lockfiles) that cause heavy conflicts during a standard interactive rebase, write a temporary helper script (Bash or Python) to rebuild the history.
      • Create a temporary branch starting at the base commit: git checkout -b rebase-temp <base>
      • For each planned clean commit:
        1. Check out the final state of the relevant files from the target HEAD: git checkout <target_head> -- <files>
        2. If a shared index file needs to be built incrementally, extract the specific changes using command-line tools (such as jq for JSON files) and apply them.
        3. Commit the staged changes, preserving the original author metadata and dates using environment variables:
          bash
          GIT_AUTHOR_DATE="<date>" GIT_COMMITTER_DATE="<date>" git commit -m "<message>"
        4. Repeat for all logical units in the planned order.
  4. Verify the Rebased History:

    • Verify that the file state at the new rebased HEAD is identical to the target HEAD:
      bash
      git diff <target_head> HEAD
      The diff must be completely empty.
    • Review the final commit history to ensure it contains exactly one logical commit per feature/file group:
      bash
      git log <base>..HEAD --oneline
  5. Update Branch Pointer:

    • Switch back to the main feature branch and hard-reset it to the rebased HEAD:
      bash
      git checkout <feature-branch>
      git reset --hard rebase-temp
      git branch -D rebase-temp

© nixified-ai, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/git-history-cleaner of nixified-ai/flake.

Open the folder on GitHubat commit b816d1e

Compare with similar skills

Git History Cleaner next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Git History Cleaner compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Git History Cleaner this skillnixified-ai/flake841—~876Automated safety check: PassAGPL-3.0
ToolJet Multi-Repo CommitToolJet/ToolJet41k—~1.3kAutomated safety check: PassAGPL-3.0
Git Workflow and Versioningaddyosmani/agent-skills105k2 repos~3.5kAutomated safety check: NotesMIT
React Router Pull Request Creatorremix-run/react-router57k—~2.5kAutomated safety check: PassMIT
Saleor Commit Workflowsaleor/saleor23k—~575Automated safety check: PassBSD-3-Clause
Emoji Commit ConventionsbaptisteArno/typebot.io11k—~424Automated safety check: PassCustom licence

Similar skills

  • Commits changes across ToolJet's root repo and its server/ee and frontend/ee submodules, writing messages from the diffs and updating submodule pointers in order.

    41k GitHub stars~1.3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Git Workflow and Versioning

    addyosmani/agent-skills

    Sets git habits for every change: short-lived branches, atomic commits with descriptive messages, clean pull requests, plus versioning, tagging and changelogs for releases.

    105k GitHub starsUsed in 2 repos~3.5k tokens
    DevelopmentAuto-check: notes
  • React Router Pull Request Creator

    remix-run/react-router

    Packages finished React Router work into a draft pull request: branch, commit, push, a written PR body and the right GitHub labels.

    57k GitHub stars~2.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Commits changes in the Saleor codebase and works through pre-commit hook failures from ruff, mypy, the GraphQL schema check and the migrations check.

    23k GitHub stars~575 tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Emoji Commit Conventions

    baptisteArno/typebot.io

    Sets the repository's convention for commit messages and pull request titles: one emoji prefix for the main intent, a concise title and clean follow-up commits.

    11k GitHub stars~424 tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Draft Pull Request Creator

    wordpress-mobile/WordPress-Android

    Commits and pushes current changes, writes a pull request title and body from the branch history and template, and opens a draft PR on GitHub after you approve it.

    3.2k GitHub stars~881 tokensUpdated yesterday
    DevelopmentAuto-check: notes

More from nixified-ai/flake

  • Comfyui Node Adder

    nixified-ai/flake

    Adds new custom nodes to the ComfyUI Nix project, including npins fetching, dependency resolution in package.nix, disabling impure pip installs, and verifying the Nix build.

    841 GitHub stars~806 tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Git History Cleaner

What does Git History Cleaner do?

Cleans up git commit history by rebasing and combining commits that edit the same files or logical units, ensuring each logical change is isolated to a single commit. Git History Cleaner is an agent skill from nixified-ai/flake. Cleans up git commit history by rebasing and combining commits that edit the same files or logical units, ensuring each logical change is isolated to a single commit.

When should I use Git History Cleaner?

Git History Cleaner fits situations like: tasks that involve Git workflow; tasks that involve Commit messages.

How do I install Git History Cleaner in Claude Code?

Run `npx skills add nixified-ai/flake --skill git-history-cleaner -a claude-code`. Or copy the skill folder (.agents/skills/git-history-cleaner in nixified-ai/flake) into .claude/skills/git-history-cleaner in your project. Claude Code loads it when a task matches its description.

How do I install Git History Cleaner in Codex?

Run `npx skills add nixified-ai/flake --skill git-history-cleaner -a codex`. Or copy the skill folder (.agents/skills/git-history-cleaner in nixified-ai/flake) into .agents/skills/git-history-cleaner in your project. Codex loads it when a task matches its description.

Can I use Git History Cleaner in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add nixified-ai/flake --skill git-history-cleaner -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/git-history-cleaner, .gemini/skills/git-history-cleaner, .github/skills/git-history-cleaner and .opencode/skills/git-history-cleaner in your project.

What does Git History Cleaner need to run?

Going by SKILL.md and its folder, Git History Cleaner needs the command-line tools its instructions call (git).

Does Git History Cleaner access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Git History Cleaner safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Git History Cleaner use?

Git History Cleaner is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Git History Cleaner use?

About 876 tokens (SKILL.md is roughly 3.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Git History Cleaner?

Skills that share tags, products or a category with Git History Cleaner: ToolJet Multi-Repo Commit (ToolJet/ToolJet, 41k stars), Git Workflow and Versioning (addyosmani/agent-skills, 105k stars), React Router Pull Request Creator (remix-run/react-router, 57k stars) and Saleor Commit Workflow (saleor/saleor, 23k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Git History Cleaner?

nixified-ai (a GitHub organization) maintains it in nixified-ai/flake, which has 841 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 9, 2026.

Source: nixified-ai/flake on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.