Git worktrees that are
ready to work.
Plain git worktree add just creates the checkout — your .env files are missing and nothing is installed. mycadre creates the worktree, copies your local config, runs your setup, and tracks it so cleanup is one command.
$ npm install -g mycadre # then, in any git repo: $ mycadre create my-feature
Why it exists
Worktrees are great for working several branches at once — reviewing a PR while your feature branch builds, or running a fleet of AI coding agents in parallel, each in its own checkout. But git worktree add alone leaves every checkout to set up by hand.
Env files are gone
Gitignored files like .env never make it into a new worktree. mycadre copies the ones you name.
Nothing is installed
No node_modules, no build. mycadre runs your setup command right after creating the checkout.
Orphans pile up
It's easy to forget which directories you made. mycadre tracks every worktree so listing and cleanup are trivial.
Zero config to start
One init writes a small mycadre.json you commit and share with your team. No global setup.
Quick start
Requires Node.js ≥ 18 and git on your PATH.
# in your project's git repo $ mycadre init # writes mycadre.json (edit to taste) $ mycadre create feature/login # new branch + worktree, env copied, setup run $ mycadre list # see your tracked worktrees $ mycadre remove feature/login # delete the worktree and its branch $ mycadre clean # prune worktrees git already dropped
Commands
Seven commands, that's the whole surface.
| Command | What it does |
|---|---|
mycadre init | Create a mycadre.json config at the repo root. |
mycadre create <branch> [--from <base>] | Create a worktree for <branch> (new branch off <base> or the current branch, unless it already exists), copy configured files into it, and run the setup command. |
mycadre list | List tracked worktrees and flag any that have gone missing. |
mycadre remove <branch> [--keep-branch] [--force] | Remove the worktree and (unless --keep-branch) delete the branch. |
mycadre clean | Prune git worktrees and drop stale tracking entries. |
mycadre doctor [--json] | Check that git, your repo, mycadre.json, worktreeDir, and tracked worktrees are all in a healthy state. Exits 1 if anything's wrong. |
mycadre fresh [--live <url>] | Read-only check before a diff, review, push, PR, deploy or publish: is HEAD built on the remote's default branch, is local main behind, is the branch's PR still open at HEAD, is production ahead. Exit 0 fresh, 1 stale, 2 could not check. More. |
Is my branch fresh?
Parallel branches go stale quietly. Someone merges to main while you work, and your diff shows their change reverted. A PR is merged while you're still pushing to its branch, and the pushes go nowhere. Production is hot-fixed from a laptop, and the next deploy rolls it back. Run mycadre fresh right before the moment it matters.
$ mycadre fresh --live https://example.com/version
✗ base: HEAD is 3 commits behind origin/main (4d1c2ab)
4d1c2ab Fix the login redirect
9e0b7f1 Bump the API client
52aa0c3 Drop the old cache
✓ local: local main matches origin/main
✗ pr: PR #42 is ALREADY MERGED — pushing to 'feature/login' goes nowhere
✓ live: production (52aa0c3) is 2 commits behind origin/main
STALE — see ✗ lines above. Nothing was changed.
base — asks the remote with git ls-remote, so an old local origin/main can't make a stale branch look current.
pr — uses gh to check the branch's PR is still open and its head is in HEAD.
live — with --live <url>, reads the deployed commit (plain text, or JSON with sha, commit or git_sha) and flags production that is ahead of the remote.
Exit 0 fresh, 1 stale, 2 could not check. Offline, no remote, or gh missing is exit 2 and never reads as fresh; --no-pr skips the PR check on purpose. --json for scripts and agents. It never checks out, rebases or pushes.
Similar tools
Worktrunk manages worktrees by branch name and adds hooks, a merge workflow, and shared build caches. Claude Code (--worktree/-w) and Cursor's Agents Window both create a worktree per parallel agent automatically. mycadre is smaller and more general: no agent runner, no build cache — one mycadre.json, copy some files, run one setup command, track what you made.
Configuration
mycadre init writes a mycadre.json at your repo root:
{
"worktreeDir": "../mycadre-worktrees",
"copy": [".env", ".env.local"],
"setup": "npm install"
}
worktreeDir — where worktrees are created, relative to the repo root.
copy — files/directories copied from the repo root into each new worktree (typically gitignored local config). Missing entries are skipped silently.
setup — a shell command run inside the new worktree after creation, or null to skip.
Commit mycadre.json so your team shares the same setup. mycadre stores tracking data in .mycadre-state.json — add that to your .gitignore.