CLITrigger: Skill for Claude Code

.claude/skills/merge-worktree/SKILL.md

merge-worktree is a skill for Claude Code from HyperAITeam/CLITrigger. It costs 38 tokens per session (1,527 once invoked), scanned A, original, MIT.

A procedure for squash-merging the current Git worktree branch into a target branch. A worktree is a separate working directory linked to a Git repository; squashing combines its commits into one.

In plain words
What is it for?
Use it to validate a worktree, identify the current and target branches, review changes, and merge the branch with a structured commit message.
Why use it?
It checks that the operation is being run in the right kind of directory and uses the branch history and source changes to prepare one clear merge commit.

Skill for Claude Code

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

This is HyperAITeam/CLITrigger's own configuration. It tells Claude Code how to work on CLITrigger itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything CLITrigger configures →

Reuse

Borrowing it

Nothing to install: this file belongs to HyperAITeam/CLITrigger. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/HyperAITeam/CLITrigger/main/.claude/skills/merge-worktree/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/HyperAITeam/CLITrigger

Made for: Claude Code.

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 merge-worktree

README.md
[![agentmods](https://agentmods.dev/badge/skills/hyperaiteam/clitrigger/merge-worktree/github.svg)](https://agentmods.dev/skills/hyperaiteam/clitrigger/merge-worktree)
Your own site
<a href="https://agentmods.dev/skills/hyperaiteam/clitrigger/merge-worktree"><img src="https://agentmods.dev/badge/skills/hyperaiteam/clitrigger/merge-worktree/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for merge-worktree

Your own site · 80×15
<a href="https://agentmods.dev/skills/hyperaiteam/clitrigger/merge-worktree"><img src="https://agentmods.dev/badge/skills/hyperaiteam/clitrigger/merge-worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,527 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00038 $0.01527
Opus 5.5 $0.00015 $0.00611
Sonnet 5.5 $0.00008 $0.00305
Haiku 4.5 $0.00004 $0.00153

Measured 2mo ago against content hash 3fd52b4c7944, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

merge-worktree 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 2mo 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.

.claude/skills/merge-worktree/SKILL.md · 154 lines

How it starts

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

Merge Worktree

Squash-merge the current worktree branch back into the target branch with a comprehensive, structured commit message.

Current context

  • Git dir: !git rev-parse --git-dir
  • Current branch: !git branch --show-current
  • Recent commits: !git log --oneline -20
  • Working tree status: !git status --short

Instructions

Follow these phases exactly, in order. Do NOT skip phases.


Phase 1: Validation

  1. Verify worktree: Check if the current git directory is a worktree. The output of git rev-parse --git-dir must contain /worktrees/. If it does not, stop immediately and tell the user:

    "This skill must be run from inside a git worktree. Use /worktree to create one first."

  2. Identify current branch: Get the worktree branch name from git branch --show-current.

  3. Resolve target branch:

    • If $ARGUMENTS is provided and non-empty, use it as the target branch.
    • Otherwise, detect the default branch: check if main exists, else check master. If neither exists, stop and ask the user.
  4. Identify the original repo path: Parse the original repo root from the git-dir path. The worktree's .git file points back to the main repo — use git rev-parse --git-common-dir to find it, then derive the original repo working directory (its parent).

  5. Clean working tree: Run git status --porcelain. If there are uncommitted changes, stop and tell the user to commit or stash them first.


Phase 2: Research

This is the most critical phase. You must deeply understand what was done before writing any commit message.

  1. Commit history: Run git log --oneline <target>..HEAD to see all commits on this worktree branch.

  2. File change summary: Run git diff <target>...HEAD --stat to get an overview of what files changed and how much.

  3. Full diff: Run git diff <target>...HEAD to read the complete diff. Study it carefully.

  4. Read key files: For the most significantly changed files (largest diffs, new files, deleted files), use the Read tool to understand the full context — not just the diff lines.

Read the full file on GitHub · 154 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. 2mo ago First seen · 154 lines · 38 tokens per session scan A 3fd52b4c7944

Subscribe to this mod's changes

merge-worktree is a skill published in the GitHub repository HyperAITeam/CLITrigger (14 stars, last pushed yesterday), licensed MIT. It adds 38 tokens to every session and 1,527 once invoked, about $0.0002 per session on Opus 5.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-30.

Related

Other skills, from other repositories

subagent-driven-branch-ref-froze-stranded-commits

Diagnose and recover from "PR merged, but half my work is missing from main" cases in superpowers:subagent-driven-development (or similar one-fresh-subagent-per-task) sessions, where committed work survives in the worktree's HEAD chain but never makes it into the pushed branch ref. Use when ANY of these appears: (1)…

wan-huiyan/agent-traffic-control · 545 tokens

batch-member-cites-a-path-only-a-non-member-adds

You wrote something correct that the default reader cannot reach: a batch member citing a path only a NON-member adds, or a rule, ruling or ledger sitting on an unlanded branch.

wan-huiyan/agent-traffic-control · 53 tokens

git-add-u-after-async-post-commit-hook

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…

wan-huiyan/agent-traffic-control · 398 tokens

working-tree-edits-stranded-on-squash-merge

Diagnose and prevent "I made the fix but it's not on main" cases where the fix was applied in the working tree via Edit / Write but never git added before the squash-merge. Use when: (1) you squash-merged a PR and the user reports the issue is back, (2) git status after the merge shows uncommitted changes for files…

wan-huiyan/agent-traffic-control · 236 tokens

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

In a repo with an ASYNC/background post-commit hook (one that fires after a commit and creates its OWN follow-up commit — [auto-docs] …, a docs/site regen, a changelog/checkbox tick), the hook's commit can land LOCAL-ONLY after your git push already captured just your work commit, so it is never in the PR and gets…

wan-huiyan/agent-traffic-control · 409 tokens

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

Use when a git commit --amend silently rewrites the WRONG commit in a repo that has an async/background post-commit hook. Trigger: after a normal commit, git log shows an unexpected extra commit on top that a background hook created ([auto-docs] ..., a docs/site regen, a changelog/checkbox tick) — and a later --amend…

wan-huiyan/agent-traffic-control · 184 tokens