
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
treehouse-worktree
Advanced tools
Git worktree manager for parallel AI agent workflows with MCP support
A cross-platform git worktree manager designed for parallel AI agent workflows. Supports both CLI and MCP (Model Context Protocol) interfaces.
When multiple AI agents need to work on the same repository simultaneously, git worktrees provide isolated working directories without the overhead of multiple clones. Treehouse simplifies worktree management with:
.cursor/worktrees.json config format# Install globally
npm install -g treehouse-worktree
# Initialize in your repo
cd your-repo
treehouse init
# Create a worktree for an agent
treehouse create feature-api --agent claude-1
# List all worktrees
treehouse list
# Complete and merge work
treehouse complete feature-api --merge
# Remove when done
treehouse remove feature-api
# npm
npm install -g treehouse-worktree
# Or run directly with npx
npx treehouse-worktree init
# Initialize configuration
treehouse init
# Create a new worktree
treehouse create <name> [branch]
treehouse create feature-api # uses 'feature-api' as branch
treehouse create agent-1 feature/new-api # uses custom branch name
# List all worktrees
treehouse list
# Get status
treehouse status # all worktrees
treehouse status feature-api # specific worktree
# Remove a worktree
treehouse remove <name>
treehouse remove feature-api --force # force remove with uncommitted changes
# Create and lock for an agent
treehouse create feature-api --agent claude-1 --message "Working on API endpoints"
# Lock an existing worktree
treehouse lock feature-api --agent claude-2 --expiry 120
# Unlock a worktree
treehouse unlock feature-api
# Just mark as complete (no merge)
treehouse complete feature-api
# Merge into current branch
treehouse complete feature-api --merge
# Squash merge with custom message
treehouse complete feature-api --merge --squash --message "Add new API endpoints"
# Merge and delete branch
treehouse complete feature-api --merge --delete-branch
# Merge into specific branch
treehouse complete feature-api --merge --target main
# Check for conflicts
treehouse conflicts
treehouse conflicts feature-api # in specific worktree
# Resolve conflicts
treehouse resolve --ours # keep current branch changes
treehouse resolve --theirs # accept incoming changes
treehouse resolve feature-api --theirs
# Abort merge
treehouse abort
treehouse abort feature-api
# Prune orphaned worktree entries
treehouse prune
# Clean old worktrees (based on config)
treehouse clean --dry-run # preview
treehouse clean # actually remove
Create treehouse.json in your repository root (or use .cursor/worktrees.json for Cursor compatibility):
{
"dir": "../worktrees",
"defaultTargetBranch": "current",
"lockExpiryMinutes": 60,
"setup-worktree": [
"npm install",
"cp \"$ROOT_WORKTREE_PATH/.env\" .env"
],
"worktree.cleanup.enabled": true,
"worktree.cleanup.retentionDays": 7,
"worktree.cleanup.maxSizeGB": 10
}
| Option | Description | Default |
|---|---|---|
dir | Directory for worktrees (relative or absolute) | ../worktrees |
defaultTargetBranch | Default branch for merges (current or branch name) | current |
lockExpiryMinutes | How long locks last before auto-expiring | 60 |
setup-worktree | Commands to run after creating a worktree | [] |
setup-worktree-unix | Unix-specific setup commands | - |
setup-worktree-windows | Windows-specific setup commands | - |
worktree.cleanup.enabled | Enable automatic cleanup | false |
worktree.cleanup.retentionDays | Remove worktrees older than N days | 7 |
worktree.cleanup.maxSizeGB | Max total size of worktrees | 0 (unlimited) |
Setup commands support:
# are skippedROOT_WORKTREE_PATH environment variable contains main repo pathExample using the environment variable:
{
"setup-worktree": [
"npm install",
"cp $ROOT_WORKTREE_PATH/.env .env"
]
}
{
"setup-worktree-unix": ".cursor/setup.sh",
"setup-worktree-windows": ".cursor/setup.ps1"
}
Treehouse includes an MCP server for integration with AI tools like Claude.
Add to your MCP configuration:
{
"mcpServers": {
"treehouse": {
"command": "treehouse-mcp"
}
}
}
Or with npx:
{
"mcpServers": {
"treehouse": {
"command": "npx",
"args": ["treehouse-worktree", "mcp"]
}
}
}
| Tool | Description |
|---|---|
treehouse_init | Initialize configuration |
treehouse_list | List all worktrees |
treehouse_create | Create a new worktree |
treehouse_status | Get worktree status |
treehouse_complete | Complete work on a worktree |
treehouse_remove | Remove a worktree |
treehouse_lock | Lock a worktree for an agent |
treehouse_unlock | Unlock a worktree |
treehouse_conflicts | Check for merge conflicts |
treehouse_resolve | Resolve conflicts |
treehouse_abort | Abort a merge |
treehouse_prune | Prune orphaned entries |
treehouse_clean | Clean old worktrees |
# Agent 1 starts working on API
treehouse create api-work --agent agent-1 --message "Implementing REST endpoints"
# Agent 2 starts working on UI (different worktree)
treehouse create ui-work --agent agent-2 --message "Building dashboard components"
# Check what's being worked on
treehouse list
# Agent 1 finishes and merges
treehouse complete api-work --merge --delete-branch
treehouse remove api-work
# Agent 2 finishes
treehouse complete ui-work --merge
treehouse remove ui-work
import { treehouse } from 'treehouse-worktree';
// Create a worktree
const result = await treehouse.create({
name: 'feature-api',
agentId: 'my-agent',
lockMessage: 'Working on API'
});
// List worktrees
const list = await treehouse.list();
// Complete work
await treehouse.complete({
name: 'feature-api',
merge: true,
deleteBranch: true
});
Treehouse looks for configuration in this order:
.cursor/worktrees.json in current worktreetreehouse.json in current worktree.cursor/worktrees.json in repo roottreehouse.json in repo rootgit --versiongit init first, or navigate to an existing git repositorygit statustreehouse listtreehouse remove <name>--force flag to remove anyway (caution: will lose changes)setup-worktree-windows in your configtreehouse unlock <name>lockExpiryMinutes configtreehouse prune to clean up orphaned entriesMIT
FAQs
Git worktree manager for parallel AI agent workflows with MCP support
We found that treehouse-worktree demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.