What is sync-worktrees?
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.
What is sync-worktrees 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.
How much does sync-worktrees cost?
Pros and 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 about sync-worktrees
What is sync-worktrees used for?
sync-worktrees automatically checks out every Git branch across one or more repositories as a persistent folder, keeping each in sync with the remote. It also runs an MCP server so AI coding agents like Claude Code or Cursor can access your entire multi-repo workspace without re-loading context.
Is sync-worktrees free?
Yes. sync-worktrees is fully free and open-source under the MIT licence. It is distributed as an npm package and has no paid tiers or subscription fees.
How does sync-worktrees integrate with AI coding agents?
sync-worktrees ships a sync-worktrees-mcp binary that exposes your entire workspace over the Model Context Protocol (MCP). Agents such as Claude Code, Cursor, Windsurf, VS Code Cline, Warp, and Gemini CLI connect to this MCP server and can browse any branch in any repo without requiring manual context re-explanation between sessions.
Does sync-worktrees work on Windows?
Not natively. sync-worktrees requires Node 22+ and currently supports macOS and Linux only.
sync-worktrees vs plain Git worktrees — what is the difference?
Native Git worktrees require manual setup per branch and repo, offer no remote sync automation, and provide no MCP integration. sync-worktrees adds automatic remote synchronisation on a schedule, configuration-driven multi-repo management, safety guards against syncing dirty trees, an interactive TUI, and the built-in MCP server for AI agent access.
What are the best alternatives to sync-worktrees?
Git worktrees (built-in), ghq, mise, Turborepo
Reviews
Sign in to rate and review sync-worktrees.
Sign in to reviewNo reviews yet. Be the first to review sync-worktrees!
