Git · plan by default

/git-worktree

Create or manage isolated working directories

Use for an explicitly selected isolated checkout; git-recover preserves lost candidates.

Make it your own.

In Claude Code, use the slash command and add your context. In Codex, select git-worktree from the just-vibe skill picker, then send the same brief.

Version 0.11.0 also supports /jv git-worktree, /just-vibe git-worktree and /jv:git-worktree in Claude. See shortcut setup and context examples.

Example · apply
/just-vibe:git-worktree Create an isolated worktree from the specified branch at the requested path.
edge · apply
/just-vibe:git-worktree Create a worktree including current edits while another worktree owns the branch.
blocked · inspect
/just-vibe:git-worktree Inspect removal of a dirty worktree; report its changes without forcing removal.

What the agent does

  1. List existing worktrees and branch ownership, and resolve the requested ref or current-state transfer.
  2. Validate the target path and verify the destination is empty before creation, or inspect removal safety.
  3. When applying, create or remove the requested worktree and verify the resulting state.

Inputs

  • path, branch/ref, and intended operation.

Optional context: scope, references, constraints, successCriteria, environment, mode, budget.

Scope

Reads
Manage the selected isolated checkout and its Git metadata.
Writes
Inspect/plan: inspect or propose; save requested artifacts only. Apply: make the requested changes or execute the requested operation within its resolved target and limits. Local preparation does not authorize live, remote, destructive or paid actions; existing explicit session authorization still applies.
Mode
Plan worktree organization; apply when the user requests creating or removing a specific local worktree.
Prerequisites
Git, exact repository/worktree, and readable refs/index. Record branch, HEAD, staged/unstaged/untracked state before mutation. Preserve unrelated edits and never default to broad staging, hard reset, clean, force push, or history rewriting.

Expected output

  • Worktree path, starting ref, branch/HEAD ownership, operation result, transferred-state verification and usage guidance.

How the work is checked

  • An existing occupied branch is handled explicitly; removing a dirty worktree stops before losing changes.

When to stop or clarify

  • Do not invent a starting branch, force removal, or delete unrelated directories. Respect the requested current-state versus clean-ref starting point.

Handling missing context

Infer
Read repository root, HEAD, branch, refs and staged/unstaged/untracked distinctions; use the configured human identity.
Assume
Limit an ambiguous inspection to the current repository and report that scope; preserve all existing changes.
Ask
Before mutation, resolve uncertain commit membership, destination ref or history-rewrite intent; do not ask again about already authorized exact actions.

Technical guidance

Evidence
Inspect worktree porcelain inventory, branch ownership, destination identity and dirty/untracked state.
Method
Create only the requested isolated checkout; keep per-worktree config and shared refs in mind during branch actions.
Pitfall
Shared Git objects do not mean every worktree has an independent branch namespace; removing a checkout can destroy untracked work.
Check
Confirm the new checkout's HEAD and root; before cleanup, verify ownership and preserve any changes produced after creation.

Situational decisions

When current uncommitted changes must move: Preserve staged/unstaged distinctions in an explicit transfer plan and validate the copy before removing originals.

When the request is for local preparation or implementation: Inspect existing branches and worktrees, then perform only the requested local lifecycle action; preserve pre-existing changes and require a resolved branch choice when ambiguous.

The coding agent follows this workflow using its available tools. Installation does not grant service access or guarantee an outcome. Read the compatibility notes.

Keep exploring