CLITrigger: Skill for Claude Code

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

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

Instructions for safely removing a Git worktree, which is a separate working directory linked to another branch, and then deleting that branch.

In plain words
What is it for?
Use it to list worktrees, select a non-main one by path or branch, review its changes, and clean it up safely.
Why use it?
It prevents accidentally removing the main worktree or losing uncommitted changes. If unfinished work exists, it requires confirmation before continuing.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: names the AskUserQuestion tool.

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/remove-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 remove-worktree

README.md
[![agentmods](https://agentmods.dev/badge/skills/hyperaiteam/clitrigger/remove-worktree/github.svg)](https://agentmods.dev/skills/hyperaiteam/clitrigger/remove-worktree)
Your own site
<a href="https://agentmods.dev/skills/hyperaiteam/clitrigger/remove-worktree"><img src="https://agentmods.dev/badge/skills/hyperaiteam/clitrigger/remove-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 remove-worktree

Your own site · 80×15
<a href="https://agentmods.dev/skills/hyperaiteam/clitrigger/remove-worktree"><img src="https://agentmods.dev/badge/skills/hyperaiteam/clitrigger/remove-worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,032 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.00031 $0.01032
Opus 5.5 $0.00012 $0.00413
Sonnet 5.5 $0.00006 $0.00206
Haiku 4.5 $0.00003 $0.00103

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

Security

Grade A, and why

remove-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/remove-worktree/SKILL.md · 105 lines

How it starts

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

Remove Worktree

워크트리를 제거하고 연결된 브랜치를 정리합니다.

Current context

  • Worktree list: !git worktree list --porcelain

Instructions

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


Phase 1: 워크트리 선택

  1. git worktree list --porcelain을 실행하여 모든 워크트리 정보를 파싱한다.

    • 각 워크트리 항목은 worktree <path>, HEAD <hash>, branch refs/heads/<name> 형태로 출력된다.
    • main worktree (현재 체크아웃된 주 저장소)는 목록에서 제외한다.
  2. $ARGUMENTS가 제공된 경우:

    • 워크트리 경로 또는 브랜치명으로 매칭되는 항목을 찾는다.
    • 경로의 마지막 부분(디렉터리명)으로도 매칭을 시도한다.
    • 매칭되는 항목이 없으면 사용 가능한 워크트리 목록을 보여주고 중단한다.
  3. $ARGUMENTS가 없는 경우:

    • 워크트리가 하나도 없으면 "제거할 워크트리가 없습니다."라고 알리고 중단한다.
    • 워크트리가 하나면 자동 선택한다.
    • 워크트리가 여러 개면 번호와 함께 목록을 보여주고 AskUserQuestion으로 선택 받는다.
      제거할 워크트리를 선택하세요:
      1. feature/task-abc123  →  .worktrees/feature-task-abc123
      2. feature/task-xyz789  →  .worktrees/feature-task-xyz789
      
  4. 선택된 워크트리의 경로와 브랜치명을 확정한다.


Phase 2: 안전 검사

  1. git -C <worktree-path> status --porcelain을 실행한다.

  2. 변경사항이 없으면: Phase 3으로 바로 진행한다.

  3. 미커밋 변경사항이 있으면:

    • 변경된 파일 목록을 보여준다.
    • AskUserQuestion으로 확인을 받는다:

      "워크트리 <branch-name>에 미커밋 변경사항이 있습니다. 강제로 제거하면 이 변경사항은 영구적으로 삭제됩니다. 계속하시겠습니까? (yes/no)"

    • "no" 또는 거부하면 중단하고 변경사항을 커밋하거나 스태시할 것을 안내한다.
    • "yes"면 강제 제거 플래그(--force)를 사용하기로 표시하고 Phase 3으로 진행한다.

Phase 3: 워크트리 제거

  1. 워크트리를 제거한다:

    • 변경사항 없음: git worktree remove <worktree-path>
    • 강제 제거: git worktree remove --force <worktree-path>
  2. 명령이 실패하면 에러 메시지를 출력하고 중단한다.

  3. git worktree list를 실행하여 워크트리가 실제로 제거되었는지 확인한다.


Phase 4: 브랜치 처리

  1. 제거된 워크트리의 브랜치명(<branch-name>)을 사용한다.

  2. AskUserQuestion으로 브랜치 삭제 여부를 확인한다:

    "브랜치 <branch-name>도 삭제하시겠습니까? (yes/no)"

  3. "yes"인 경우:

    • git branch -D <branch-name>을 실행한다.
    • 실패하면 에러를 보고하되 전체 작업은 성공으로 처리한다.
  4. "no"인 경우: 브랜치를 그대로 유지한다.


Phase 5: 완료 보고

다음 내용을 요약하여 보고한다:

  • 제거된 워크트리 경로
  • 삭제된 브랜치 (삭제한 경우) 또는 유지된 브랜치 (유지한 경우)
  • 원격 브랜치가 존재할 경우 안내:

    원격 브랜치도 삭제하려면: git push origin --delete <branch-name>

Read the full file on GitHub · 105 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 · 105 lines · 31 tokens per session scan A a5ec622717cb

Subscribe to this mod's changes

remove-worktree is a skill published in the GitHub repository HyperAITeam/CLITrigger (14 stars, last pushed yesterday), licensed MIT. It adds 31 tokens to every session and 1,032 once invoked, about $0.0001 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

pr-from-stale-branch-silently-reverts-newer-main-files

Trap: merging a PR whose branch carries an OLD TREE silently DELETES (reverts) files that landed on main after that tree was built — with NO merge conflict to warn you, because a deletion your own commit records is not a conflict. Use when: (1) about to gh pr create or squash-merge from a long-lived / earlier-branched…

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

prep-pr-close-keyword-auto-closes-issue

Diagnose and prevent the trap where a scaffolding/prep/planning/handoff PR (one that ships a paste-ready prompt, an ADR, an implementation plan, or any docs-only artefact describing FUTURE work) contains a close-keyword like closes #N / fixes #N / resolves #N in its TITLE or BODY, which GitHub auto-applies at merge…

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

stale-base-pr-silently-reverts-upstream-content

Detect and recover when a sibling PR's squash-merge silently reverts an upstream PR's content changes because the sibling was based on a pre-upstream main snapshot and its line-level rewrites overlapped the upstream PR's edits. Use when: (1) two PRs are open in parallel against the same file(s) — one refreshing…

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

cross-worktree-spec-handoff-via-checkout-paths

Pass a shared file between two parallel sessions in different worktrees or branches, without merging to main first — a design spec, docs, a handoff prompt, a mockup. git checkout -- stages it. Use when a session says "the file doesn't exist". Not co editing.

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

docs-branch-off-feature-branch-smuggles-code

Catch the bug class where a "docs follow-up" PR silently ships the parent feature's code under a docs(sN): title because the docs branch was created from the current working branch (a feature branch), not from origin/main. Use when: (1) you just opened a PR titled docs(...) or chore(...) after wrapping up a feature…

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

gh-issue-claim-coordination

Before writing code for a GitHub issue when another session might take the same one, claim it with BOTH an assignee and a wip label so a sibling sees it and skips. Trigger on "pick up issue #N", "work through the open issues", "is anyone on this?". Not for filing or reviewing.

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