worktree-setuplisted
Install: claude install-skill mickzijdel/dev-hooks
# worktree-setup
A fresh worktree is a clean `git` checkout — and that's the problem. The committed files are
there, but everything the working tree needs that git *doesn't* track is not: the `mise.toml`
is untrusted, gitignored secrets/config (`config/master.key`, `.env`, service-account JSON) are
absent, and `core.fileMode=false` checkouts can land shebang scripts without `+x`. So the app
won't boot and the tooling errors until you fix each by hand — every single time.
This skill closes those gaps in one step. It **provisions** a worktree; it does not create one
(only the harness can switch the session into a worktree). Use it *with* [[using-git-worktrees]],
not instead of it.
## Workflow
1. **Ensure `.worktrees/` is ignored.** Before creating any project-local worktree, confirm the
directory is gitignored so its contents never get tracked:
```bash
git check-ignore -q .worktrees || printf '.worktrees/\n' >>.gitignore # then commit it
```
(The native `EnterWorktree` tool uses `.claude/worktrees/`, which is already kept out of
status; only the manual `git worktree add` fallback needs this.)
2. **Branch from local HEAD, not origin.** Your local `main` often leads or lags `origin`; a
worktree branched from origin silently drops local commits.
```bash
git config worktree.baseref head
```
(`setup-worktree.sh` also sets this, idempotently, for next time.)
3. **Create the worktree.** Prefer the native tool so the session switches into it: