git-add-u-after-async-post-commit-hook SKILL.md skillA
git-add-u-after-async-post-commit-hook from wan-huiyan/agent-traffic-control is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add wan-huiyan/agent-traffic-control/git-add-u-after-async-post-commit-hook@v1.0.0Pins v1.0.0 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- wan-huiyan/agent-traffic-control
- Path
plugins/agent-traffic-control/skills/git-add-u-after-async-post-commit-hook/SKILL.md- Versions recorded
- 3
- Latest version
- v1.0.0, committed Jul 8, 2026
- First version recorded
- May 13, 2026
- Size
- 9,637 bytes
- Repository stars
- 3
- License
- MIT
Prevent (and recover from) `git add -u` + `git commit --amend` + `git push --force-with-lease` catastrophically rolling thousands of unrelated tracked-file deletions into an amended commit when the project has an async post-commit hook that mutates tracked files (e.g. regenerates `docs/site/*.html`, `docs/site/index.html`, `MEMORY.md`, or any other tracked artefact in a background `&` / `nohup` / "running … in background" process). Use when: (1) you just made a small commit, the post-commit…
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# `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:
```sh
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/
…Read the whole file at its exact version.
How to install
mdr add wan-huiyan/agent-traffic-control/git-add-u-after-async-post-commit-hook@sha256:ae0048b1cd6727caThe line at the top of this page pins the label v1.0.0, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_pokuef2e3hpyver2)
3 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 3 versions of this file, between May 13, 2026 and Jul 8, 2026, about one every 28 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| v1.0.0 latest | 2026-07-08 | b0f0d02 | 9,637 B | A | view · diff |
| v1.0.0 | 2026-07-08 | f1254dd | 9,645 B | A | view · diff |
| v1.0.0 | 2026-05-13 | 07472bf | 9,614 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (9637 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
wan-huiyan/agent-traffic-control · 3 stars · license MIT · pushed 2026-09-22 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_pokuef2e3hpyver2 GET https://markdownregistry.com/api/v1/resolve?ref=wan-huiyan/agent-traffic-control/git-add-u-after-async-post-commit-hook GET https://markdownregistry.com/api/v1/blob/ae0048b1cd6727cae08ab1d4b0aa82a166759a40ae881a4cd0303e98fb549c6e
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.