git-worktrees

git-worktrees is a skill for Claude Code from ArtemioPadilla/agent-triforce. It costs 41 tokens per session (718 once invoked), scanned A, original, MIT.

A guide for using Git worktrees, which are separate working folders linked to the same Git repository. Each worktree can hold its own branch and changes without altering the main folder.

In plain words
What is it for?
Use it to create and clean up isolated feature branches, run baseline tests, and give separate agents their own working folders.
Why use it?
It keeps feature work, parallel changes, and risky experiments isolated from the main workspace and checks that the project starts from a passing test state.

Skill for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: mentions subagents.

Good fit Use it to create and clean up isolated feature branches, run baseline tests, and give separate agents their own working folders.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/artemiopadilla/agent-triforce/git-worktrees
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 ArtemioPadilla/agent-triforce --skill git-worktrees
Clone the repo
git clone --depth 1 https://github.com/ArtemioPadilla/agent-triforce

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/artemiopadilla/agent-triforce/git-worktrees"><img src="https://agentmods.dev/badge/skills/artemiopadilla/agent-triforce/git-worktrees.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 718 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.00041 $0.00718
Opus 5 $0.00020 $0.00359
Sonnet 5 $0.00008 $0.00144
Haiku 4.5 $0.00004 $0.00072

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

Security

Grade A, and why

git-worktrees 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 9d 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/git-worktrees/SKILL.md · 114 lines

How it starts

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

Git Worktrees

Manage an isolated worktree for: $ARGUMENTS

When to Use

  • Starting feature implementation (keeps main workspace clean)
  • Parallel development (multiple features simultaneously)
  • Risky experiments (delete worktree if it fails, main untouched)
  • Subagent isolation (agents work in worktree, can't pollute main)

Create Worktree

PROJECT_ROOT="$(git rev-parse --show-toplevel)"
PROJECT_NAME="$(basename "$PROJECT_ROOT")"
FEATURE_NAME="{feature-name}"  # kebab-case, no spaces

WORKTREE_DIR="../${PROJECT_NAME}-worktrees/feat-${FEATURE_NAME}"
BRANCH_NAME="feat/${FEATURE_NAME}"

git worktree add -b "$BRANCH_NAME" "$WORKTREE_DIR"
cd "$WORKTREE_DIR"

Verify Clean Baseline

After creating the worktree, run the project's test suite:

# Detect and run test command
if [ -f "package.json" ]; then
    npm test
elif [ -f "pyproject.toml" ] || [ -f "setup.py" ]; then
    pytest
elif [ -f "Cargo.toml" ]; then
    cargo test
elif [ -f "go.mod" ]; then
    go test ./...
fi

If tests fail: Fix baseline before starting implementation. Do not proceed with a broken baseline.

During Implementation

  • All work happens in the worktree directory
  • Commit frequently to the feature branch
  • Main workspace remains untouched
  • Subagents receive the worktree path, not the main project path

Finish Branch

When implementation is complete, present exactly these 4 options:

Implementation complete. What would you like to do?

1. Merge back to {base-branch} locally
2. Push and create a Pull Request
3. Keep the branch as-is (I'll handle it later)
4. Discard this work

Option 1: Merge Locally

BASE_BRANCH="main"  # or detected base
cd "$PROJECT_ROOT"
git checkout "$BASE_BRANCH"
git pull
git merge "$BRANCH_NAME"
# Verify tests pass on merged result
git branch -d "$BRANCH_NAME"
git worktree remove "$WORKTREE_DIR"

Option 2: Push + Create PR

git push -u origin "$BRANCH_NAME"
gh pr create --title "{title}" --body "## Summary
- {changes}

## Test Plan
- [ ] {verification steps}"

Worktree kept until PR merges.

Read the full file on GitHub · 114 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. 9d ago First seen · 114 lines · 41 tokens per session scan A 380378ed6c38

Subscribe to this mod's changes

git-worktrees is a skill published in the GitHub repository ArtemioPadilla/agent-triforce (3 stars, last pushed 4mo ago), licensed MIT. It adds 41 tokens to every session and 718 once invoked, about $0.0002 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.