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.
npx agentmods add skills/wan-huiyan/agent-traffic-control/git-add-u-after-async-post-commit-hooknpx skills add wan-huiyan/agent-traffic-control --skill git-add-u-after-async-post-commit-hookgit clone --depth 1 https://github.com/wan-huiyan/agent-traffic-controlWrote 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.
[](https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/git-add-u-after-async-post-commit-hook)<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/git-add-u-after-async-post-commit-hook"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/git-add-u-after-async-post-commit-hook.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00398 | $0.02522 |
| Opus 5 | $0.00199 | $0.01261 |
| Sonnet 5 | $0.00080 | $0.00504 |
| Haiku 4.5 | $0.00040 | $0.00252 |
Grade A, and why
git-add-u-after-async-post-commit-hook 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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 239 lines — stays where its author put it; the contents beside it link to each section on GitHub.
git add -u after async post-commit hook stages tracked-file deletions
Problem
You make a clean commit. The project's post-commit hook prints something like:
[post-commit] Python files changed — running doc update in background...
You then need to amend the commit (typo in message, wrong issue reference, etc.). You reach for the muscle-memory sequence:
git add -u && git commit --amend -m "..." # ← TRAP
The amend output reports something terrifying:
[your-branch 480e2226] fix(...): your message
1493 files changed, 4 insertions(+), 368977 deletions(-)
delete mode 100644 .claude-memory/MEMORY.md
delete mode 100644 .claude-memory/SESSION_CHECKPOINT_*.md
delete mode 100644 scripts/...
...
If you immediately ran git push --force-with-lease, that catastrophe is now
on the remote branch. The remote PR diff shows thousands of unrelated deletions
mixed with your intended 6-file fix.
git status afterwards reveals the smoking gun — files that WERE tracked before
the amend now show as Untracked:
On branch your-branch
Your branch is up to date with 'origin/your-branch'.
Untracked files:
.claude-memory/
.cursor/
.github/
MEMORY.md
PRODUCT.md
scripts/
Why it happens
The async post-commit hook fires after your first commit and starts a background process that:
- Reads tracked files (e.g.
MEMORY.md,docs/site/*.html). - Regenerates / renames / moves / deletes them as part of doc rebuild logic.
- May run
git rmor otherwise mutate the index.
The hook is async (& / nohup), so the commit returns immediately and you
get the prompt back. The hook is still running.
When you then run git add -u, git stages every change to tracked files —
including all the deletions/modifications the hook performed. When you --amend,
those deletions become part of the commit. Force-push propagates them to the
remote.
Trigger conditions
ALL of these together:
- Project has a post-commit hook that prints
running ... in background,running ... in &,nohup, or similar — visible ingit commitoutput. - You commit, see the hook log line, and don't wait for the background process.
- You run
git add -u(orgit add .from repo root) before amending or before staging your next intentional change. - Your
git diff --staged --statreports far more files than you touched.
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.
- 5d ago First seen · 239 lines · 398 tokens per session scan A ae0048b1cd67
git-add-u-after-async-post-commit-hook is a skill published in the GitHub repository wan-huiyan/agent-traffic-control (3 stars, last pushed 2d ago), licensed MIT. It adds 398 tokens to every session and 2,522 once invoked, about $0.0020 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.
Other skills, from other repositories
claude-code-bash-patterns
Claude Code Bash tool patterns with hooks, automation, git workflows. Use for PreToolUse hooks, command chaining, CLI orchestration, custom commands, or encountering bash permissions, command failures, security guards, hook configurations.
merge-worktree
Squash-merge the current worktree branch into the main branch (or a specified target). Analyzes git history and source code to craft a comprehensive commit message.
git-commit
Turn the working changes into one or more atomic commits with well-written messages. Use whenever the user runs /git-commit or asks to commit their work, wrap up a feature, or "commit what I have.".
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.
commit-style
Commit message style guidelines. Use when writing or proposing git commit messages, including direct git commit commands outside the /commit skill.
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.