agentleFS
louisbrulenaudetlouisbrulenaudet/monorepo-template/.cursor/rules/core/worktrees.mdc

monorepo-template / core

Cursor rule18 starsChanged 59 days agoApache-2.0View on GitHub

Worktree provisioning - install step, cone-mode sparsePaths, and .worktreeinclude contents.

The file

Files
worktrees.mdc
---
description: "Worktree provisioning - install step, cone-mode sparsePaths, and .worktreeinclude contents."
alwaysApply: false
globs: .worktreeinclude,.claude/settings.json
---

# Worktrees

- `worktree.symlinkDirectories` cannot replace the per-worktree `pnpm install` (root `AGENTS.md`): pnpm keeps a `node_modules` at the root and in every workspace package, and a symlinked root one would make a worktree install write into the main checkout. The install hardlinks from the store, so it costs CPU once, not disk.
- `worktree.sparsePaths` is applied as a **cone-mode** sparse checkout: every root-level file is checked out whether listed or not; only directories are filtered. The directory entries do the work (`.agents`, `.changeset`, `.claude`, `.cspell`, `.cursor`, `.github`, `.playwright`, `.vite-hooks`, `.vscode`, `apps`, `hooks`, `packages`); the root-file entries stay so the list is still correct if the checkout stops being cone-mode. Add any new root directory the tooling needs; `.opencode` is excluded on purpose.
- `.worktreeinclude` copies matching gitignored files into each new worktree. It has no patterns today, so a worktree starts with cold Turbo and Node compile caches. Never add env or credential files - provision isolated credentials per worktree ([guardrails.mdc](guardrails.mdc)). A `WorktreeCreate` hook would disable `.worktreeinclude` entirely, which is why there is none.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.