{"_id":"@aarhusgregersen/worktree-cli","_rev":"5-0397fb1c64fc5731c49acd862a4b13ed","name":"@aarhusgregersen/worktree-cli","dist-tags":{"latest":"2.0.2"},"versions":{"1.2.0":{"name":"@aarhusgregersen/worktree-cli","version":"1.2.0","keywords":["git","worktree","cli","developer-tools"],"author":{"name":"Martin Aarhus Gregersen"},"license":"MIT","_id":"@aarhusgregersen/worktree-cli@1.2.0","maintainers":[{"name":"aarhusgregersen","email":"marting12@live.dk"}],"homepage":"https://github.com/aarhusgregersen/worktree-cli#readme","bugs":{"url":"https://github.com/aarhusgregersen/worktree-cli/issues"},"bin":{"wtr":"dist/cli.js","worktree-cli":"dist/cli.js"},"dist":{"shasum":"e052f27171f04e4c4e338d8893a8dd084efdf828","tarball":"https://registry.npmjs.org/@aarhusgregersen/worktree-cli/-/worktree-cli-1.2.0.tgz","fileCount":4,"integrity":"sha512-ZGcKYNWpTQ0C7L4p9qbjM+z1mh5ymAKpvBJcBLr2ftkfp9DkdDGpEq1EODwq+WqtfkXr/ZF/bPebdg3PCtKjzw==","signatures":[{"sig":"MEYCIQCHm6gIPnxsncQUHCKYehDw81DffY2v7fe0Zt02mLtitQIhAPJmDeST9tOoRlZzFLASKJN9szCYevOeQOz8sx8ZbBDK","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":75245},"type":"module","engines":{"node":">=20.0.0"},"gitHead":"4085f507d7701bcc6753233d66c57f7483530bce","scripts":{"dev":"tsup --watch","lint":"biome check src","test":"vitest run","build":"tsup","lint:fix":"biome check --write src","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"aarhusgregersen","email":"marting12@live.dk"},"repository":{"url":"git+https://github.com/aarhusgregersen/worktree-cli.git","type":"git"},"_npmVersion":"11.11.0","description":"CLI tool for managing git worktrees with smart environment setup","directories":{},"_nodeVersion":"24.14.1","dependencies":{"commander":"^14.0.0","cli-table3":"^0.6.5","picocolors":"^1.1.0","@clack/prompts":"^0.11.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"4.0.18","typescript":"~5.7.0","@types/node":"^22.0.0","@biomejs/biome":"^1.9.0"},"_npmOperationalInternal":{"tmp":"tmp/worktree-cli_1.2.0_1777535589009_0.9610546859979738","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@aarhusgregersen/worktree-cli","version":"1.3.0","keywords":["git","worktree","cli","developer-tools"],"author":{"name":"Martin Aarhus Gregersen"},"license":"MIT","_id":"@aarhusgregersen/worktree-cli@1.3.0","maintainers":[{"name":"aarhusgregersen","email":"marting12@live.dk"}],"homepage":"https://github.com/aarhusgregersen/worktree-cli#readme","bugs":{"url":"https://github.com/aarhusgregersen/worktree-cli/issues"},"bin":{"wtr":"dist/cli.js","worktree-cli":"dist/cli.js"},"dist":{"shasum":"4287e86245dd7aa6d613f528cc107d5e98622671","tarball":"https://registry.npmjs.org/@aarhusgregersen/worktree-cli/-/worktree-cli-1.3.0.tgz","fileCount":4,"integrity":"sha512-z3o8XruGL5qlest2xl1RFurDrTzAOZPmkiUxM3xTeanw2+VAywz22qcIL8cO8MzzDbNTGfQ3IULIlTE4g6i0aQ==","signatures":[{"sig":"MEUCIEUs9ozfQtCwix4wM1Rhw8pVxcAk3Ub4QQjQTTdFF6HwAiEAqhX972k1MkSN2XILwdp5duB362DDBk3OxY8FfmLIFTI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":76316},"type":"module","engines":{"node":">=20.0.0"},"gitHead":"6a0d9a61b8aa15b10d64e3b8a0e77b7055088695","scripts":{"dev":"tsup --watch","lint":"biome check src","test":"vitest run","build":"tsup","lint:fix":"biome check --write src","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"aarhusgregersen","email":"marting12@live.dk"},"repository":{"url":"git+https://github.com/aarhusgregersen/worktree-cli.git","type":"git"},"_npmVersion":"11.11.0","description":"CLI tool for managing git worktrees with smart environment setup","directories":{},"_nodeVersion":"24.14.1","dependencies":{"commander":"^14.0.0","cli-table3":"^0.6.5","picocolors":"^1.1.0","@clack/prompts":"^0.11.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"4.0.18","typescript":"~5.7.0","@types/node":"^22.0.0","@biomejs/biome":"^1.9.0"},"_npmOperationalInternal":{"tmp":"tmp/worktree-cli_1.3.0_1779278857837_0.059185280490809955","host":"s3://npm-registry-packages-npm-production"}},"1.3.1":{"name":"@aarhusgregersen/worktree-cli","version":"1.3.1","keywords":["git","worktree","cli","developer-tools"],"author":{"name":"Martin Aarhus Gregersen"},"license":"MIT","_id":"@aarhusgregersen/worktree-cli@1.3.1","maintainers":[{"name":"aarhusgregersen","email":"marting12@live.dk"}],"homepage":"https://github.com/aarhusgregersen/worktree-cli#readme","bugs":{"url":"https://github.com/aarhusgregersen/worktree-cli/issues"},"bin":{"wtr":"dist/cli.js","worktree-cli":"dist/cli.js"},"dist":{"shasum":"ff6ab786f5a48e6690be36a5a1298cc6fa266b1b","tarball":"https://registry.npmjs.org/@aarhusgregersen/worktree-cli/-/worktree-cli-1.3.1.tgz","fileCount":4,"integrity":"sha512-E2VhTY+IO/H+EqvsMSMV2B0iEonqXrjVhq9XPx/f2H/ZcD+ZmzFALeBxfcGL9ZJmkOHLFeQHXMQAq5l7krHaNw==","signatures":[{"sig":"MEYCIQCr1duqeyL0teOEtsxojuMV3jztegOafcEwDDRl1u2SQQIhAOpJJX4DJcQUiFhS2RJ4qBCMpDy5ubnyf83V9H9cuN94","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":76431},"type":"module","engines":{"node":">=20.0.0"},"gitHead":"c953046ae2aac3c3c04eed39d4272d20196cb048","scripts":{"dev":"tsup --watch","lint":"biome check src","test":"vitest run","build":"tsup","lint:fix":"biome check --write src","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"aarhusgregersen","email":"marting12@live.dk"},"repository":{"url":"git+https://github.com/aarhusgregersen/worktree-cli.git","type":"git"},"_npmVersion":"11.13.0","description":"CLI tool for managing git worktrees with smart environment setup","directories":{},"_nodeVersion":"24.16.0","dependencies":{"commander":"^14.0.0","cli-table3":"^0.6.5","picocolors":"^1.1.0","@clack/prompts":"^0.11.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"4.0.18","typescript":"~5.7.0","@types/node":"^22.0.0","@biomejs/biome":"^1.9.0"},"_npmOperationalInternal":{"tmp":"tmp/worktree-cli_1.3.1_1781262618612_0.8927879373823726","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@aarhusgregersen/worktree-cli","version":"2.0.1","keywords":["git","worktree","cli","developer-tools"],"author":{"name":"Martin Aarhus Gregersen"},"license":"MIT","_id":"@aarhusgregersen/worktree-cli@2.0.1","maintainers":[{"name":"aarhusgregersen","email":"marting12@live.dk"}],"homepage":"https://github.com/aarhusgregersen/worktree-cli#readme","bugs":{"url":"https://github.com/aarhusgregersen/worktree-cli/issues"},"bin":{"wtr":"dist/cli.js","worktree-cli":"dist/cli.js"},"dist":{"shasum":"ae74cd84a5b800a2c0338ecb7315634bd4ea4dcc","tarball":"https://registry.npmjs.org/@aarhusgregersen/worktree-cli/-/worktree-cli-2.0.1.tgz","fileCount":4,"integrity":"sha512-SRNsWrzz4myC1nvltmQib4QfmQYWO2fd0frf4u773AxzySvL7VjAdVuNWaaqwn1bzKiakydXSqnPCxEg0eWw+A==","signatures":[{"sig":"MEYCIQCSZhbCaTRQXTJv9oIneA2cv3pk2Au8gMQrTI0rXwzlTgIhAJyPM2lOWP/ayJtd8eQOFKLjVZnyrWocdatUHG6ghczD","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":77769},"type":"module","engines":{"node":">=20.0.0"},"gitHead":"73d94ddc177040edabc2eb59d2b51d96c38f8fad","scripts":{"dev":"tsup --watch","lint":"biome check src","test":"vitest run","build":"tsup","lint:fix":"biome check --write src","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build"},"_npmUser":{"name":"aarhusgregersen","email":"marting12@live.dk"},"repository":{"url":"git+https://github.com/aarhusgregersen/worktree-cli.git","type":"git"},"_npmVersion":"11.13.0","description":"CLI tool for managing git worktrees with smart environment setup","directories":{},"_nodeVersion":"24.16.0","dependencies":{"commander":"^14.0.0","cli-table3":"^0.6.5","picocolors":"^1.1.0","@clack/prompts":"^0.11.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"4.0.18","typescript":"~5.7.0","@types/node":"^22.0.0","@biomejs/biome":"^1.9.0"},"_npmOperationalInternal":{"tmp":"tmp/worktree-cli_2.0.1_1784279015507_0.21386509598750725","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@aarhusgregersen/worktree-cli","version":"2.0.2","description":"CLI tool for managing git worktrees with smart environment setup","type":"module","bin":{"wtr":"dist/cli.js","worktree-cli":"dist/cli.js"},"engines":{"node":">=20.0.0"},"scripts":{"build":"tsup","dev":"tsup --watch","lint":"biome check src","lint:fix":"biome check --write src","test":"vitest run","test:watch":"vitest","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"keywords":["git","worktree","cli","developer-tools"],"author":{"name":"Martin Aarhus Gregersen"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/aarhusgregersen/worktree-cli.git"},"bugs":{"url":"https://github.com/aarhusgregersen/worktree-cli/issues"},"homepage":"https://github.com/aarhusgregersen/worktree-cli#readme","dependencies":{"@clack/prompts":"^0.11.0","cli-table3":"^0.6.5","commander":"^14.0.0","picocolors":"^1.1.0"},"devDependencies":{"@biomejs/biome":"^1.9.0","@types/node":"^22.0.0","tsup":"^8.0.0","typescript":"~5.7.0","vitest":"4.0.18"},"gitHead":"8838cae0f19284d6e58cceabd4972c0a56c5dae1","_id":"@aarhusgregersen/worktree-cli@2.0.2","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-thyDoz7TwreENd1z5Q77ofS1ksuEOTMDrOmC655fNpyYlOFDxi6SytqZ408WMXrH8Ovs5J2Z4JW7JzIXHHOMuA==","shasum":"e57c392a87993cba30bfd5eac036e901bf4b80f3","tarball":"https://registry.npmjs.org/@aarhusgregersen/worktree-cli/-/worktree-cli-2.0.2.tgz","fileCount":4,"unpackedSize":78865,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCEyRXY9zyuldbFdq6oOm77P4A8hArvHxkzA9BIHPBCewIgY8VzZ4gxkn5jVU6/VXAFHfGFFYa9kuX7m8e8hHIXjeE="}]},"_npmUser":{"name":"aarhusgregersen","email":"marting12@live.dk"},"directories":{},"maintainers":[{"name":"aarhusgregersen","email":"marting12@live.dk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/worktree-cli_2.0.2_1784920028270_0.9463958153001226"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-30T07:53:08.930Z","modified":"2026-07-24T19:07:08.548Z","1.2.0":"2026-04-30T07:53:09.133Z","1.3.0":"2026-05-20T12:07:37.973Z","1.3.1":"2026-06-12T11:10:18.740Z","2.0.1":"2026-07-17T09:03:35.630Z","2.0.2":"2026-07-24T19:07:08.421Z"},"bugs":{"url":"https://github.com/aarhusgregersen/worktree-cli/issues"},"author":{"name":"Martin Aarhus Gregersen"},"license":"MIT","homepage":"https://github.com/aarhusgregersen/worktree-cli#readme","keywords":["git","worktree","cli","developer-tools"],"repository":{"type":"git","url":"git+https://github.com/aarhusgregersen/worktree-cli.git"},"description":"CLI tool for managing git worktrees with smart environment setup","maintainers":[{"name":"aarhusgregersen","email":"marting12@live.dk"}],"readme":"# wtr — Git Worktree Manager\n\nCLI tool for managing git worktrees with smart environment setup, port bumping, and Claude Code integration.\n\n## Installation\n\n```bash\nnpm install -g @aarhusgregersen/worktree-cli\n```\n\nRequires Node.js >= 20 and git.\n\n## Quick Start\n\n```bash\n# Initialize in your repo\nwtr init\n\n# Create a worktree (auto-creates branch, copies env files, bumps ports)\nwtr add feature/auth\n\n# List worktrees\nwtr list\n\n# Check status of all worktrees\nwtr status\n\n# Open a worktree in a new terminal with Claude Code\nwtr add feature/login --open\n\n# Remove when done\nwtr remove feature/auth\n```\n\n## Commands\n\n### `wtr init`\n\nInitialize wtr for the current repository. Scans for common config files (.env, .vscode/, etc.) and creates `.wtr.json`.\n\n```bash\nwtr init          # Interactive setup\nwtr init -y       # Use defaults\nwtr init --json   # JSON output\n```\n\n### `wtr add <branch> [path]`\n\nCreate a new worktree. Automatically creates the branch if it doesn't exist, copies config files, and bumps ports.\n\n```bash\nwtr add feature/auth                    # Create worktree\nwtr add feature/auth --open             # Create and open terminal with Claude\nwtr add feature/auth --plan \"Add JWT\"   # Create, open, and start Claude with a plan\necho \"plan\" | wtr add feature/x --plan -  # Read plan from stdin\nwtr add feature/auth --base develop     # Branch from develop\nwtr add feature/auth --no-copy          # Skip file copying\nwtr add feature/auth --no-bump          # Skip port bumping\nwtr add feature/auth --json             # JSON output\n```\n\n### `wtr list`\n\nList all worktrees with path, branch, HEAD, status, and last activity.\n\n```bash\nwtr list            # Table format (excludes main)\nwtr ls -a           # Include main worktree\nwtr list --json     # JSON output (includes lastCommit)\nwtr list --porcelain  # Tab-separated for scripting\n```\n\n### `wtr status`\n\nShow enriched status: ahead count, diff stats, dirty state, push status, PR info, Claude activity, and last commit.\n\n```bash\nwtr status          # Table format\nwtr st -a           # Include main worktree\nwtr status --no-pr  # Skip PR lookups (faster)\nwtr status --json   # JSON output\n```\n\n### `wtr current`\n\nShow which worktree you're currently in.\n\n```bash\nwtr current         # Human output: branch @ /path (abc1234)\nwtr current --json  # JSON: { path, branch, isMain, head }\n```\n\n### `wtr cd <id>`\n\nPrint a worktree's path. Designed for shell integration:\n\n```bash\ncd $(wtr cd 2)                  # cd to worktree #2\ncd $(wtr cd feature/auth)       # cd by branch name\n```\n\n### `wtr exec <id> <cmd...>`\n\nRun a command inside a worktree directory. Sets `WT_*` environment variables.\n\n```bash\nwtr exec 1 git status          # Run git status in worktree #1\nwtr exec feature/auth npm test  # Run tests in a specific worktree\nwtr exec 2 ls --json           # JSON output with captured stdout/stderr\n```\n\n### `wtr each <cmd...>`\n\nRun a command in every non-main worktree sequentially.\n\n```bash\nwtr each git status             # Status of all worktrees\nwtr each npm test --bail        # Run tests, stop on first failure\nwtr each git pull --include-main  # Include main worktree\nwtr each npm test --json        # JSON output with all results\n```\n\n### `wtr sync [id]`\n\nSync worktree(s) with the default branch via rebase (default) or merge.\n\n```bash\nwtr sync              # Sync current worktree (auto-detect from cwd)\nwtr sync 1            # Sync worktree #1\nwtr sync --all        # Sync all non-main worktrees\nwtr sync --merge      # Use merge instead of rebase\nwtr sync --no-fetch   # Skip git fetch origin\nwtr sync --json       # JSON output\n```\n\n### `wtr open [id]`\n\nOpen a worktree in a new terminal window. Supports iTerm2, Apple Terminal, Ghostty, and Warp.\n\n```bash\nwtr open 1                           # Open worktree #1\nwtr open feature/auth --claude       # Open with Claude Code\nwtr open 1 --plan \"Implement auth\"   # Open with Claude and a plan\necho \"plan\" | wtr open 1 --plan -   # Read plan from stdin\nwtr open 1 --json                    # JSON (doesn't open terminal)\n```\n\n### `wtr diff [id]`\n\nShow diff for a worktree against the default branch.\n\n```bash\nwtr diff 1              # Full diff\nwtr diff 1 --stat       # Diffstat summary\nwtr diff 1 --uncommitted  # Working tree changes\nwtr diff 1 --base develop  # Diff against specific branch\n```\n\n### `wtr pr [id]`\n\nCreate a GitHub pull request for a worktree. Requires [GitHub CLI](https://cli.github.com).\n\n```bash\nwtr pr 1                    # Interactive PR creation\nwtr pr 1 --title \"Add auth\" --draft  # Create draft PR\nwtr pr 1 --json             # JSON output\n```\n\n### `wtr remove [id]`\n\nRemove a worktree and optionally delete the branch.\n\n```bash\nwtr remove 1                  # Interactive removal\nwtr rm 1 -y                   # Skip confirmation\nwtr remove 1 --delete-branch  # Also delete branch\nwtr remove 1 --force          # Force remove (locked/dirty)\n```\n\n### `wtr clean`\n\nClean up a repo in one command. By default it does **both**: prunes stale\nworktree entries (directories that no longer exist on disk) **and** removes\nworktrees whose branches have been merged — detected via git merge **or** a\nmerged GitHub PR (so squash-merges count too).\n\n```bash\nwtr clean                     # Prune stale + remove merged (both)\nwtr clean --dangling          # Only prune stale entries\nwtr clean --merged            # Only remove merged worktrees\nwtr clean --dry-run           # Preview only, no changes\nwtr clean --delete-branches   # Also delete the associated branches\nwtr clean --force -y          # Include dirty worktrees, skip confirmation\n```\n\nWorktrees with uncommitted changes are skipped unless `--force` is given.\n\n### `wtr completions [shell]`\n\nGenerate shell completions. Auto-detects shell from `$SHELL`.\n\n```bash\n# Bash\nwtr completions bash >> ~/.bashrc\n\n# Zsh\nwtr completions zsh > ~/.zfunc/_wtr\n\n# Fish\nwtr completions fish > ~/.config/fish/completions/wtr.fish\n```\n\n## Configuration\n\n### Local: `.wtr.json`\n\nCreated by `wtr init` in the repository root. Add to `.gitignore`.\n\n```json\n{\n  \"copyFiles\": [\".env\", \".env.local\", \".vscode/settings.json\"],\n  \"portOffset\": 100,\n  \"portExclusions\": [],\n  \"terminal\": {\n    \"mode\": \"window\",\n    \"autoMode\": false,\n    \"focus\": false\n  }\n}\n```\n\n### Global: `~/.wt/config.json`\n\nFallback configuration used when no local `.wtr.json` exists.\n\n### Fields\n\n| Field | Default | Description |\n|-------|---------|-------------|\n| `copyFiles` | `[]` | File/directory patterns to copy from main worktree |\n| `portOffset` | `100` | Port increment per worktree index |\n| `portExclusions` | `[]` | Additional port variable patterns to exclude from bumping |\n| `terminal.mode` | `\"window\"` | `\"window\"` or `\"tab\"` — how new sessions open |\n| `terminal.autoMode` | `false` | Pass `--permission-mode auto` when launching Claude |\n| `terminal.focus` | `false` | If `true`, the new terminal window steals focus. Default keeps focus on your current app. |\n\n### Port Bumping\n\nPorts in `.env` files are automatically incremented based on worktree index:\n\n- Worktree #2: PORT=3000 becomes PORT=3100\n- Worktree #3: PORT=3000 becomes PORT=3200\n\n**Built-in exclusions** (never bumped): DATABASE, DB_PORT, POSTGRES, PG_, MYSQL, MONGO, REDIS, CACHE, QUEUE, RABBIT, KAFKA, ELASTIC, OPENSEARCH, MEMCACHE.\n\nAdd custom exclusions via `portExclusions`:\n\n```json\n{\n  \"portExclusions\": [\"SMTP\", \"LDAP\"]\n}\n```\n\n## JSON Mode & Error Codes\n\nAll commands support `--json` for structured output. Errors include machine-readable codes:\n\n```json\n{\n  \"error\": \"Worktree not found: foo\",\n  \"code\": \"WORKTREE_NOT_FOUND\"\n}\n```\n\n**Error codes:** `NOT_GIT_REPOSITORY`, `NOT_INITIALIZED`, `WORKTREE_NOT_FOUND`, `BRANCH_EXISTS`, `BRANCH_NOT_FOUND`, `CANNOT_REMOVE_MAIN`, `WORKTREE_LOCKED`, `GH_NOT_AVAILABLE`, `INSIDE_WORKTREE`, `NOT_INSIDE_WORKTREE`, `EXEC_FAILED`, `SYNC_FAILED`, `IDENTIFIER_REQUIRED`.\n\n## Claude Code Integration\n\n`wtr` is designed to work well with [Claude Code](https://claude.com/claude-code):\n\n- **`--json`** on all commands provides structured output for programmatic use\n- **Error codes** let Claude handle specific failures gracefully\n- **`wtr current --json`** tells Claude which worktree it's in\n- **`wtr exec <id> <cmd>`** runs commands in worktrees with `WT_*` env vars\n- **`--plan`** flags pipe instructions directly to Claude Code\n- **`wtr each`** runs commands across all worktrees\n\n### Setup\n\nRunning `wtr init` will offer to add wtr instructions to `~/.claude/CLAUDE.md` so that Claude Code always knows how to use `wtr` correctly — including preferring `--plan` or `--open` when creating worktrees. This is recommended for all users.\n\nIf you skipped this during init, you can add the following to `~/.claude/CLAUDE.md` manually:\n\n```markdown\n## wtr (worktree-cli)\nUse `wtr` to manage git worktrees for parallel development. Prefer this over\nraw `git worktree` commands. Key commands:\n- `wtr add <branch> --plan \"...\"` — create worktree and delegate task to Claude (preferred)\n- `wtr add <branch> --open` — create worktree and open terminal with interactive Claude\n- `wtr add <branch>` — create worktree only, no terminal (rarely needed)\n- `wtr list` — list worktrees\n- `wtr status` — enriched status with branch/commit/PR info\n- `wtr remove <id>` — remove a worktree\n- `wtr pr <id>` — create a GitHub PR for a worktree\nAll commands support `--json` for structured output.\n\nWhen creating a worktree, almost always use `--plan` (if you have instructions to\ndelegate) or `--open` (if interactive exploration is needed). Using bare `wtr add`\nwithout either flag is rare — only do it when the user explicitly doesn't want a\nterminal opened. After `--plan` or `--open`, hand off and do NOT continue the\ndelegated task in the current session.\n```\n\n### Example: Claude Code Workflow\n\n```bash\n# Create worktree with a plan for Claude\nwtr add feature/auth --plan \"Implement JWT authentication with refresh tokens\"\n\n# Check what Claude is working on\nwtr status\n\n# Sync all worktrees with main\nwtr sync --all\n\n# Clean up after merge\nwtr clean -y --delete-branches\n```\n\n## Environment Variables\n\nWhen opening terminals or running commands, `wtr` sets:\n\n| Variable | Description |\n|----------|-------------|\n| `WT_ACTIVE` | Always `1` when inside a wtr-managed terminal |\n| `WT_NAME` | Directory name of the worktree |\n| `WT_BRANCH` | Branch name |\n| `WT_PATH` | Absolute path to the worktree |\n\n## License\n\nMIT\n","readmeFilename":"README.md"}