git-amend-hits-async-post-commit-hook-commit

git-amend-hits-async-post-commit-hook-commit is a skill for Claude Code, Codex from wan-huiyan/agent-traffic-control. It costs 184 tokens per session (1,040 once invoked), scanned A, original, MIT.

A guide to a Git problem involving background post-commit hooks, which automatically create follow-up commits after your commit finishes.

In plain words
What is it for?
Use it when an unexpected generated commit appears and you need to inspect commit order before amending or repairing history.
Why use it?
It prevents `git commit --amend` from silently changing the hook's newer commit instead of your own earlier commit.

Skill for Claude CodeCodex

Part of the agent-traffic-control plugin — 58 skills shipped together

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/wan-huiyan/agent-traffic-control/git-amend-hits-async-post-commit-hook-commit
Any agent
npx skills add wan-huiyan/agent-traffic-control --skill git-amend-hits-async-post-commit-hook-commit
Clone the repo
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control

Made for: Claude Code, Codex.

Or install agent-traffic-control, the plugin that ships this one along with the rest of its 58 skills.

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 git-amend-hits-async-post-commit-hook-commit

README.md
[![agentmods](https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/git-amend-hits-async-post-commit-hook-commit.svg)](https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/git-amend-hits-async-post-commit-hook-commit)
Your own site
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/git-amend-hits-async-post-commit-hook-commit"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/git-amend-hits-async-post-commit-hook-commit.svg" alt="Measured on agentmods" height="20"></a>
Per session 184 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,040 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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.00184 $0.01040
Opus 5 $0.00092 $0.00520
Sonnet 5 $0.00037 $0.00208
Haiku 4.5 $0.00018 $0.00104

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

Security

Grade A, and why

git-amend-hits-async-post-commit-hook-commit 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 3d 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.

plugins/agent-traffic-control/skills/git-amend-hits-async-post-commit-hook-commit/SKILL.md · 84 lines

How it starts

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

git commit --amend hits the async post-commit hook's commit

Problem

A repo has an async post-commit hook — it fires in the background after a commit and creates its OWN follow-up commit (auto-generated docs, a site regen, a changelog or plan-checkbox tick). If you (or a subagent) run git commit --amend after that hook has fired, --amend rewrites the hook's commit, not your work commit. Your change's content is folded into a commit titled e.g. [auto-docs] ...; your real feat(...) commit is left untouched. The amend "succeeds" — no error — so it is easy to miss.

Context / Trigger Conditions

  • The repo has a background/async post-commit hook (look for a post-commit hook that backgrounds work, or commits with prefixes like [auto-docs], chore: regenerate site, etc. appearing without a human authoring them).
  • You ran git commit, then later git commit --amend (often a code-review fix, a typo fix, or "tidy the last commit").
  • git log shows HEAD's message is the hook's, not yours — and your change is inside that hook commit.
  • Especially common in subagent-driven development: a fix subagent is told to --amend its fix, but the async hook committed between the implementer subagent's commit and the fix subagent running.

Solution

  1. Never git commit --amend in a repo with an async post-commit hook — and never instruct a subagent to. Use a fresh git commit. A clean extra commit is harmless (it squash-merges away); a misplaced --amend is silent structural corruption.
  2. Re-read git log yourself after every commit. Do not trust an agent-reported SHA — the async hook shifts HEAD after the agent reports. Determine BASE/HEAD for the next step by reading git log --oneline.
  3. If you genuinely must amend: first confirm HEAD is YOUR commit (git log -1 --format='%s'), and ideally disable the hook for the operation.

Verification

git log --oneline -3 immediately after committing — confirm your commit message sits on the commit you intend, and note any [auto-docs] / regen commit the hook added on top.

Read the full file on GitHub · 84 lines

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. 3d ago First seen · 84 lines · 184 tokens per session scan A d9f8660ab099

Subscribe to this mod's changes

git-amend-hits-async-post-commit-hook-commit is a skill published in the GitHub repository wan-huiyan/agent-traffic-control (3 stars, last pushed 17d ago), licensed MIT. It adds 184 tokens to every session and 1,040 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

misuzu

Respond to PR review comments semi-automatically. Fetches all review threads and comments, splits them into logical units, fixes and commits one unit at a time, then replies and resolves review threads. Use when the user wants to address PR review feedback or respond to review comments.

ncaq/konoka · 59 tokens

commit-style

Commit message style guidelines. Use when writing or proposing git commit messages, including direct git commit commands outside the /commit skill.

ncaq/konoka · 28 tokens

bridge

Join a shared per-project chat between AI coding agents (Claude Code, Cursor, …) — group channels + DMs — and receive messages from other instances using whatever your agent supports (push, loop, or poll). Use when coordinating multiple agent instances on the same project.

msanchezdev/agent-bridge · 57 tokens

codex-coplan

Bring in an external model (Codex) to co-develop a plan — both models draft independently, align on disagreements, and merge into one plan. Load this only when the user explicitly names Codex (e.g. "let's discuss this with Codex," "what does Codex think about this approach") — don't auto-trigger just because a plan…

jiayx01/codex-claude-skills · 92 tokens

loop-implement

Close a single implementation task with a methodology-grounded verification loop — define done, analyze, plan, write tests first (Red), implement (Green), run, self-review, get an independent test-quality audit, then judge against done; on failure reflect and retry (bounded). Use for one non-trivial task (feature…

choiyounggi/loop-orchestrator · 88 tokens

codex-orchestrator

Delegate execution tasks to Codex (Claude plans and reviews). Load this only when the user names Codex explicitly — no matter how big the task is, if the user hasn't mentioned Codex, do it yourself.

jiayx01/codex-claude-skills · 49 tokens