commit-fixup

commit-fixup is a skill for Claude Code, Codex from 2ykwang/agent-skills. It costs 110 tokens per session (1,354 once invoked), scanned A, a copy of commit-fixup, MIT.

A skill for folding uncommitted changes into the earlier commits where they belong, using fixup commits and an autosquash rebase. A rebase rewrites the branch's commit history.

In plain words
What is it for?
Amending changes into existing commits and preparing a cleaner commit history on the current branch.
Why use it?
It cleans up review edits and keeps each commit focused, but requires safety checks because rewriting history can affect shared branches.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/2ykwang/agent-skills/commit-fixup
Any agent
npx skills add 2ykwang/agent-skills --skill commit-fixup
Clone the repo
git clone --depth 1 https://github.com/2ykwang/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for commit-fixup

README.md
[![agentmods](https://agentmods.dev/badge/skills/2ykwang/agent-skills/commit-fixup.svg)](https://agentmods.dev/skills/2ykwang/agent-skills/commit-fixup)
Your own site
<a href="https://agentmods.dev/skills/2ykwang/agent-skills/commit-fixup"><img src="https://agentmods.dev/badge/skills/2ykwang/agent-skills/commit-fixup.svg" alt="Measured on agentmods" height="20"></a>
Per session 110 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,354 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00110 $0.01354
Opus 5 $0.00055 $0.00677
Sonnet 5 $0.00022 $0.00271
Haiku 4.5 $0.00011 $0.00135

Measured 4d ago against content hash 118bca25ac80, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

commit-fixup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to commit-fixup — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/commit-fixup/SKILL.md · 126 lines

How it starts

The opening of the file, as written. The whole thing — 126 lines — stays where its author put it; the contents beside it link to each section on GitHub.

commit-fixup

Absorb uncommitted changes into the existing commit each one should have been part of, leaving clean history. Four stages: safety checks → mapping → scope confirmation → execution and verification. This rewrites history, so don't skip any stage's checks.

1. Safety checks

git status --short                       # uncommitted changes
git merge-base HEAD origin/<default-branch>  # establish base (use the repo's default branch)
git log --oneline <base>..HEAD           # commits in scope
git branch -vv                           # upstream and push state
git log --merges --oneline <base>..HEAD  # merge commits in range
git --version

Tell the user before proceeding if any of these hit:

  • Branch already pushed → stop and ask. Rebasing means a force-push afterwards, and only the user makes that call. Never run a force-push on your own.
  • Merge commits in range → stop. The rebase flattens the merge structure.
  • git older than 2.44 → don't proceed. That version lacks the non-interactive git rebase --autosquash this skill relies on. Say the git version is too old to automate this safely and point at an upgrade (macOS: brew upgrade git, Ubuntu: apt upgrade git).
  • Untracked files are not absorption targets. Leave them alone.

2. Mapping: find the target commit for each changed file

For each modified file, find the commit in branch range that touched it last:

git log --oneline <base>..HEAD -- <file> | head -1

Why last-toucher: even when an earlier commit is the semantic owner, if a later commit also touched the file, fixing up into the earlier one makes the rebase conflict. The last-toucher rule guarantees a conflict-free, fully automatic rebase. It trades a little history aesthetics for safety — call out the affected files in the mapping table.

Mapping results fall into three buckets:

  • Mapped: a commit in the branch touched that file
  • Unmapped: no commit touched it (new file, or a change to a file from outside the branch)
  • One file's changes needing to split across several commits → references/edge-cases.md

Read the full file on GitHub · 126 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 126 lines · 110 tokens per session scan A 118bca25ac80

Subscribe to this mod's changes

commit-fixup is a skill published in the GitHub repository 2ykwang/agent-skills (19 stars, last pushed 1mo ago), licensed MIT. It adds 110 tokens to every session and 1,354 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to commit-fixup, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

ship-it

Code commit, PR creation, merge, and issue closure workflow via GitHub CLI (gh). Triggers after a goal (GitHub Issue) implementation is complete — commit code, push branch, create PR, merge, then close the issue. Use when the user says "提交代码", "commit and merge", "创建PR", "合入", "关闭issue", "ship-it", or when a goal…

smallnest/goal-workflow · 96 tokens

commit

変更を意味単位のコミットに分割し,各メッセージを全文で提案.承認後にステージ〜コミットのみ実行する(push しない).「コミットして」「変更を記録して」など,記録を求められたときに使う(スキル名の指定は要らない)——素の git commit で済ませない.版を公にするなら /capstone:release を使う..

tomoking2004/claude-plugins · 109 tokens

command-development

This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash…

mahmoud20138/Tradecraft · 99 tokens

to-issues

Decompose a PRD and/or SPEC into implementable, vertically-sliced Issues with real blocking edges, then create them in your chosen platform (GitHub or Local). Use after /prd (and optionally /prd-to-spec) to turn requirements into agent-ready tickets. Triggers on: create issues, to-issues, 创建issue, 拆解issue, 生成卡片, 创建卡片…

smallnest/goal-workflow · 96 tokens

article-icons

Illustrate an article (Markdown, HTML, etc.) with animated-style icons from itshover.com/icons. Fetches icons as clean inline SVG and places them at section headings, key concepts, lists, and callouts. Triggers on: /article-icons, 配图, 给文章配图标, add icons to article, illustrate with icons.

smallnest/goal-workflow · 74 tokens

re0-git

Rewrite a finished commit's message into a clean, handoff-ready form in your own log style, so git log alone tells the story. User-invoked: run it after a commit.

LilMGenius/paperthin · 46 tokens