async-post-commit-hook-commit-orphaned-by-squash-merge

async-post-commit-hook-commit-orphaned-by-squash-merge is a skill for Claude Code from wan-huiyan/agent-traffic-control. It costs 409 tokens per session (1,906 once invoked), scanned A, original, MIT.

Guidance for recovering commits created by an asynchronous post-commit hook. Such a hook runs after a commit and may create another commit later in the background.

In plain words
What is it for?
Use it to find and preserve local-only hook commits containing generated documentation or related updates.
Why use it?
It addresses the risk that a later hook commit is pushed too late, so it is missing from a pull request that was squash-merged.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: mentions Claude Code.

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

Good fit Use it to find and preserve local-only hook commits containing generated documentation…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wan-huiyan/agent-traffic-control/async-post-commit-hook-commit-orphaned-by-squash-merge
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.

Any agent
npx skills add wan-huiyan/agent-traffic-control --skill async-post-commit-hook-commit-orphaned-by-squash-merge
Clone the repo
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control

Made for: Claude Code.

Or install agent-traffic-control, the plugin that ships this one along with the rest of its 105 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 async-post-commit-hook-commit-orphaned-by-squash-merge

README.md
[![agentmods](https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/async-post-commit-hook-commit-orphaned-by-squash-merge.svg)](https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/async-post-commit-hook-commit-orphaned-by-squash-merge)
Your own site
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/async-post-commit-hook-commit-orphaned-by-squash-merge"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/async-post-commit-hook-commit-orphaned-by-squash-merge.svg" alt="Measured on agentmods" height="20"></a>
Per session 409 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,906 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00409 $0.01906
Opus 5 $0.00204 $0.00953
Sonnet 5 $0.00082 $0.00381
Haiku 4.5 $0.00041 $0.00191

Measured 6d ago against content hash f8f86593796d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

async-post-commit-hook-commit-orphaned-by-squash-merge 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 6d 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/async-post-commit-hook-commit-orphaned-by-squash-merge/SKILL.md · 134 lines

How it starts

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

Async post-commit hook's commit is orphaned by a squash-merge

Problem

A repo has an async post-commit hook that fires in the background after each commit and creates its OWN follow-up commit — typically auto-generated docs, a site regen, or a "correct the design doc to match the code you just changed" edit (you'll see [post-commit] … running doc update in background… at commit time and an [auto-docs] … commit appear seconds-to-minutes later).

The race that loses content:

  1. You commit your fix (feat/fix …).
  2. git push -u origin <branch> runs — and completes before the async hook finishes, so the remote has only your fix commit.
  3. You open the PR and squash-merge it. The squash-merge is built from the pushed remote state → it contains only your fix commit.
  4. Then the background hook's [auto-docs] commit lands — local-only, on top of your branch. It's never pushed, never in the PR, never on main.

Now your local branch is [ahead 1] of origin/<branch>, holding a commit with real, useful content (e.g. a design doc corrected to match your change). If you delete the merged branch or just start the next task, that content is silently lost — and because it was the hook's job to keep the doc in sync, nobody re-generates it.

Context / Trigger Conditions

  • The repo has a background/async post-commit hook (greppable: a post-commit hook that backgrounds work; commits prefixed [auto-docs] / chore: regenerate with no human author intent).
  • You pushed → PR'd → squash-merged a branch this session.
  • git status -sb on that (still-checked-out) branch shows ## <branch>...origin/<branch> [ahead 1] (or ahead N) even though you believe it fully merged.
  • git log --oneline shows the top local commit is the hook's, authored after your work commit, and it touches files (a design doc, a site asset) — not empty.

Solution

Before deleting the branch or moving on, rescue the orphan.

  1. See it. On the just-merged branch:
    git status -sb            # "[ahead 1]" of origin = unpushed local commit(s)
    git log --oneline -3      # top one is the [auto-docs]/hook commit?
    git show <sha> --stat     # what content did the hook generate?
    
  2. Judge it. If the orphan is genuinely valuable (a doc corrected to match your merged change, a needed regen) → rescue. If it's noise (a no-op regen, already-correct) → discard, no action.
  3. Confirm the target still exists on main (main may have moved many commits since your fix):
    git cat-file -e origin/main:<path-the-hook-edited> && echo EXISTS
    
  4. Rescue by cherry-pick onto a fresh branch off origin/main (NOT onto the stale/merged branch), and fold it into your next PR — the session-handoff PR is the natural home:
    git fetch origin
    git checkout -b <handoff-branch> origin/main
    git cherry-pick <sha>           # the [auto-docs] commit applies cleanly
    # … add handoff docs, commit, PR, merge
    

Read the full file on GitHub · 134 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. 6d ago First seen · 134 lines · 409 tokens per session scan A f8f86593796d

Subscribe to this mod's changes

async-post-commit-hook-commit-orphaned-by-squash-merge is a skill published in the GitHub repository wan-huiyan/agent-traffic-control (3 stars, last pushed yesterday), licensed MIT. It adds 409 tokens to every session and 1,906 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.

Related

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.

secondsky/claude-skills · 52 tokens

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.".

thoughtbot/rails-consultant · 47 tokens

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

commit

One-shot conventional commit; bundled scripts adaptively gather diff context, draft the message, and stage+commit — pass ask to confirm first or add a hint for the title. Use only when the user asks for a commit.

foyzulkarim/skills · 49 tokens

pre-commit

Fast pre-commit quality gate: scans staged files for secrets, dead code, naming issues, merge conflict markers, and direct-to-main commits. Installs as a git hook via /pre-commit install.

RealDougEubanks/ClaudeMarketplace · 46 tokens