git-amend-hits-async-post-commit-hook-commitlisted
Install: claude install-skill wan-huiyan/agent-traffic-control
# `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 aw