Git worktree manager with Linear integration
npm install santree
![]()
A beautiful CLI for managing Git worktrees
Create, switch, and manage Git worktrees with ease.
Integrates with GitHub PRs and Linear tickets via Claude AI.
---
``bash`
npm install -g santree
Add to your .zshrc or .bashrc:
`bash`
eval "$(santree shell-init zsh)" # for zsh
eval "$(santree shell-init bash)" # for bash
This enables automatic directory switching after create and switch commands.
The shell integration also provides:
- st - Alias for santreestw
- - Quick create worktree with --work --plan --tmux (prompts for branch name)
`bash`
santree doctor
This checks that all required tools are installed and configured correctly.
---
`bashCreate a new worktree and switch to it
santree create feature/my-new-feature
---
Commands
| Command | Description |
|---------|-------------|
|
santree list | List all worktrees with PR status and commits ahead |
| santree create | Create a new worktree from base branch |
| santree switch | Switch to another worktree |
| santree remove | Remove a worktree and its branch |
| santree sync | Sync current worktree with base branch |
| santree setup | Run the init script (.santree/init.sh) |
| santree work | Launch Claude AI to work on the current ticket |
| santree clean | Remove worktrees with merged/closed PRs |
| santree doctor | Check system requirements and integrations |
| santree statusline | Statusline wrapper for Claude Code |---
Features
$3
Create isolated worktrees for each feature branch. No more stashing or committing WIP code just to switch tasks.$3
See PR status directly in your worktree list. Clean up worktrees automatically when PRs are merged or closed.$3
Launch Claude with full context about your current ticket using santree work. Supports different modes:
- --plan - Create an implementation plan only
- --review - Review changes against ticket requirements
- --fix-pr - Address PR review comments$3
Run custom setup scripts when creating worktrees. Perfect for copying .env files, installing dependencies, or any project-specific setup.---
Configuration
$3
Create
.santree/init.sh in your repository root:`bash
#!/bin/bash
cp "$SANTREE_REPO_ROOT/.env" "$SANTREE_WORKTREE_PATH/.env"
npm install
`$3
For Linear integration, use branch names with ticket IDs:
`
user/TEAM-123-feature-description
feature/PROJ-456-add-auth
`$3
`bash
claude mcp add --transport http linear https://mcp.linear.app/mcp
`$3
Santree provides a custom statusline for Claude Code showing git info, model, context usage, and cost.
Add to
~/.claude/settings.json:
`json
{
"statusLine": {
"type": "command",
"command": "santree statusline"
}
}
`The statusline displays:
repo | branch | S: staged | U: unstaged | A: untracked | Model | Context% | $Cost---
Command Options
$3
| Option | Description |
|--------|-------------|
| --base | Base branch to create from (default: main/master) |
| --work | Launch Claude after creating |
| --plan | With --work, only create implementation plan |
| --no-pull | Skip pulling latest changes |
| --tmux | Open worktree in new tmux window |$3
| Option | Description |
|--------|-------------|
| --rebase | Use rebase instead of merge |$3
Removes the worktree and deletes the branch. Uses force mode by default (removes even with uncommitted changes).$3
Shows worktrees with merged/closed PRs and prompts for confirmation before removing.$3
| Option | Description |
|--------|-------------|
| --plan | Only create implementation plan |
| --review | Review changes against requirements |
| --fix-pr | Fetch and fix PR comments |---
Requirements
| Tool | Purpose |
|------|---------|
| Node.js >= 20 | Runtime |
| Git | Worktree operations |
| GitHub CLI (
gh`) | PR integration |