| allowed-tools | description |
|---|---|
Bash(git:*), Bash(mkdir:*), Bash(open:*), Bash(gnome-terminal:*), Bash(xterm:*), Bash(konsole:*) |
Create git worktree in adjacent directory and open terminal with claude |
Creates a git worktree in an adjacent directory structure and opens a new terminal with claude running.
- Git root: !
git rev-parse --show-toplevel 2>/dev/null || echo "Not a git repository" - Current branch: !
git branch --show-current 2>/dev/null || echo "No current branch" - Git status: !
git status --porcelain 2>/dev/null || echo "Not a git repository"
Create a git worktree for branch: $ARGUMENTS
Follow these steps:
- Verify we're in a git repository
- Get the git root directory name
- Create adjacent directory structure:
{root_dir}_worktree - Create git worktree inside that directory with branch name from arguments
- Copy
.claudedirectory to worktree directory - Open new terminal in the worktree directory
- Run
claudecommand in the new terminal
Requirements:
- If branch doesn't exist, create it from current branch
- Handle existing worktree directories gracefully
- Support both macOS and Linux terminal opening
- Auto-start claude in the new terminal session
Example usage: /worktree feature-branch