git-worktree

git-worktree is a skill for Claude Code, Codex from hmj1026/dhpk. It costs 63 tokens per session (545 once invoked), scanned A, original, MIT.

A Git worktree management workflow for adding, listing, removing, or pruning extra working folders connected to one repository. It checks branch, path, and dirty-worktree conditions before suggesting or performing changes.

In plain words
What is it for?
Use it to create an additional worktree, inspect existing worktrees, or safely prepare their removal or pruning. It reports exact commands, paths, branches, and resulting status.
Why use it?
It reduces mistakes when several working folders are used for different branches. It also requires confirmation before removing or pruning worktrees and will not bypass dirty-worktree checks.

Skill for Claude CodeCodex

Written for Claude Code and Codex: disable-model-invocation in frontmatter, but also agents/openai.yaml present.

Part of the dhpk plugin — 39 skills, 1 command, 1 agent, 3 hooks shipped together

Good fit Use it to create an additional worktree, inspect existing worktrees, or safely prepare their removal or pruning. It reports exact commands, paths, branches, and resulting status.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hmj1026/dhpk/git-worktree
View source ↗ hmj1026/dhpk
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 hmj1026/dhpk --skill git-worktree
Clone the repo
git clone --depth 1 https://github.com/hmj1026/dhpk

Made for: Claude Code, Codex.

Or install dhpk, the plugin that ships this one along with the rest of its 39 skills, 1 command, 1 agent, 3 hooks.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/hmj1026/dhpk/git-worktree"><img src="https://agentmods.dev/badge/skills/hmj1026/dhpk/git-worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 545 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.00063 $0.00545
Opus 5.5 $0.00025 $0.00218
Sonnet 5.5 $0.00013 $0.00109
Haiku 4.5 $0.00006 $0.00055

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

Security

Grade A, and why

git-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 yesterday.

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.

generated/claude-marketplace/package/skills/git-worktree/SKILL.md · 55 lines

What it actually says

Git Worktree

Workflow

Run from the consumer repository. Resolve one sub-command and preserve [add|list|remove|prune] [--branch <name>] [--base <ref>]. Inspect git worktree list --porcelain and the current branch first. Resolve every target path and branch explicitly; a missing branch/path or dirty relevant worktree stops the operation.

Use native Git operations only. add uses the repository parent and the wt-{repo-shortname}-{purpose} naming convention, then reports the exact git worktree add command and next steps. list reports each worktree and status. remove and prune preview their exact targets and require explicit confirmation before mutation; never use a force option to bypass a dirty check. The detailed command sequence is in references/workflow.md.

When NOT to Use

  • A merge, rebase, branch deletion, or remote operation is requested.
  • The target worktree is missing, ambiguous, or dirty.
  • Removal or pruning has not received explicit confirmation.

Output

  • add: exact command, created path, branch, and next steps.
  • list: a formatted table derived from native worktree records.
  • remove/prune: confirmation state, exact target/command, and resulting status; no confirmation means NOT_RUN.
  • Missing or dirty targets and native Git failures are terminal failures.

Verification

  • Every target path and branch was resolved before a write.
  • Relevant worktrees were checked with git status --porcelain.
  • Remove/prune has explicit confirmation, or no mutation was attempted.
  • Final git worktree list --porcelain evidence matches the report.

References

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday Changed · +2 lines f36326f905e3
  2. 23d ago First seen · 53 lines · 63 tokens per session scan A 8da543f3d80e

Subscribe to this mod's changes

git-worktree is a skill published in the GitHub repository hmj1026/dhpk (2 stars, last pushed today), licensed MIT. It adds 63 tokens to every session and 545 once invoked, about $0.0003 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-09-24.

Related

Other skills, from other repositories

avatar-contribution-pr

Turn an avatar GitHub issue (from the in-app avatar-editor easter egg) into a merged sprite — validate the art, then either add a new module or replace an existing one, and open a PR that closes the issue. Handles both "Avatar contribution: " (a brand-new sprite) and "Avatar edit: " (a hand-redraw of an existing…

khromov/codebay · 0 tokens

release

Release a new version of the mumei repository. Invoke when the user gives an explicit release instruction ("release it", "/release", "patch release", "ship 0.2.0"). Takes no argument or "patch" / "minor" / "major" for a SemVer bump, or a direct version such as "0.2.0". Wraps any uncommitted changes into a single…

iroha924/mumei · 144 tokens

generator-fix-integrator

Internal Auto-Harness generator skill for worktree-merge fix integration. Use only inside the parallel Generator integrator when it is addressing named defects from QA or retest.

redker56/auto-harness · 40 tokens

open-code-review

Performs AI-powered code review on Git changes using the ocr CLI from alibaba/open-code-review. Use when the user asks to review code, review a pull request, review staged/unstaged changes, review a commit, or compare branches for code quality issues. Produces line-level review comments and can automatically apply…

alibaba/open-code-review · 98 tokens

update-pr

Update an existing pull request with new changes. Use when the user wants to update a PR, push follow-up changes to a PR, refresh a PR description, or sync a PR with latest commits. Triggers on: update pr, update-pr, update the pr, push to pr, refresh pr, sync pr, update pull request.

ReflexioAI/claude-smart · 71 tokens

merge-prep

Pre-merge analysis and preparation. Analyzes source branch vs target branch: commit stats, conflict detection, file impact. Analysis-only v1 — outputs report + suggested commands, does not auto-merge. Use when: user says 'merge prep', 'pre-merge', 'merge analysis', or /merge-prep.

sd0xdev/sd0x-harness · 69 tokens