Overview / Description
sync-worktrees is an AI developer tool that automatically maintains a checked-out folder for every Git branch across every repository, keeping each worktree synchronized with the remote and exposing all of them to AI coding agents over the Model Context Protocol (MCP). Developers and AI agent teams no longer need to stash changes, re-clone repositories, or re-explain the codebase context each time they switch branches — every branch just lives as a persistent directory you can cd into.
The tool is configuration-driven: declare your repositories and branch glob patterns once in a config file, and any teammate or new machine can rebuild an identical workspace from that declaration. Shared Git object storage means multiple branches share one .git database, significantly reducing disk usage compared to keeping separate clones. A built-in interactive terminal UI (TUI) lets you create branches, view sync status, and manage worktrees without leaving the terminal.
For AI coding workflows, the bundled sync-worktrees-mcp binary exposes your entire multi-repo workspace to agents like Claude Code, Cursor, Windsurf, VS Code Cline, and Warp over MCP — eliminating the repeated context-loading that slows down AI-assisted development. Safety mechanisms prevent data loss by refusing to sync worktrees that have uncommitted changes, unpushed commits, or stashes; force-pushed history is moved to a .diverged/ directory rather than discarded. Age-based pruning and sparse checkout support for monorepos round out the feature set.
sync-worktrees is free and open-source (MIT licence), distributed as an npm package requiring Node 22+ on macOS or Linux. It is aimed at development teams managing multiple interconnected repositories and at any developer who regularly hands context to AI coding agents.
Used For
Automatically maintaining checked-out Git worktrees across multiple repos and exposing the full workspace to AI coding agents via MCP, so developers and AI agents can switch branches without re-cloning or re-explaining context.
Pricing
Pros & Cons
Pros
- MCP server binary exposes all worktrees to AI agents (Claude Code, Cursor, Windsurf) without re-explaining context
- Shared Git object store reduces disk usage compared to separate clones for each branch
- Configuration-driven setup lets teams or new machines reproduce an identical workspace from one file
- Interactive TUI for branch creation, status viewing, and worktree management in-terminal
- Safety guards refuse sync on uncommitted changes or unpushed commits; force-pushed history moved to .diverged/ rather than lost
Cons
- Requires Node 22+ and runs only on macOS or Linux — no native Windows support
- Free open-source project with no commercial support tier; relies on community contributions
- Learning curve for teams new to Git worktrees and MCP server configuration
- No GUI or web dashboard — purely CLI and TUI driven
Questions & Answers
Alternatives
Git worktrees (built-in), ghq, mise, Turborepo
Reviews & Ratings
0 reviews
Sign in to rate and review sync-worktrees.
Sign in to reviewNo reviews yet. Be the first to review sync-worktrees!