AgentStack
SKILL verified CC0-1.0 Self-run

Worktree

skill-jhostalek-dotclaude-worktree · by JHostalek

Use when starting new feature work that should happen in an isolated git worktree on its own branch.

No reviews yet
0 installs
16 views
0.0% view→install

Install

$ agentstack add skill-jhostalek-dotclaude-worktree

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Worktree? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

input = $ARGUMENTS

Branch Name

Derive from input; ask if missing. Default: /, conventional commit types (feat when ambiguous). Check git branch first — if repo uses different convention (e.g., feature/JIRA-123-desc), match it.

Show derived name before proceeding.

Worktree Location

  • {repo_root}/.claude/worktrees/{branch_slug} where branch_slug replaces / with -
  • repo_root = git rev-parse --show-toplevel
  • Ensure .claude/worktrees/ exists and is in .gitignore

Base Branch

Branch from latest remote default, not HEADHEAD can be stale or on an unrelated branch, silently seeding the worktree with wrong history.

Detect default: git symbolic-ref refs/remotes/origin/HEAD | sed 's|refs/remotes/origin/||' (fallback: try main, then master). Fetch: git fetch origin {default_branch}. Create: git worktree add -b {branch} {directory} origin/{default_branch}.

Branch already exists → git worktree add {directory} {branch} (no -b).

After creation, symlink gitignored files so worktree runs without reinstall:

bash ~/.claude/skills/worktree/scripts/symlink-gitignored.sh {repo_root} {directory}

Output

Show: worktree path, claude --cwd {directory} command, reminder to use /worktree-clean when done, and git worktree list.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.