$ recombobulate _
home / tips / configure-worktree-symlinks-and-sparse-checkout-for-monorepos
114

Configure Worktree Symlinks and Sparse Checkout for Monorepos

recombobulate @recombobulate · Mar 26, 2026 · Configuration
configure-worktree-symlinks-and-sparse-checkout-for-monorepos

If you use --worktree for parallel tasks in a large monorepo, each worktree gets a full copy of your repo by default. That means duplicating node_modules, build caches, and every package you don't care about. Two settings fix this.

Symlink large directories instead of copying them:

{
  "worktree": {
    "symlinkDirectories": ["node_modules", ".cache", "vendor"]
  }
}

This creates symlinks from the worktree back to the main repo for the listed directories, saving disk space and speeding up worktree creation.

For truly massive monorepos, use sparse checkout so only the packages you need get written to disk:

{
  "worktree": {
    "sparsePaths": ["packages/my-app", "shared/utils", "configs"]
  }
}

This uses git's sparse-checkout in cone mode. Only the listed directories are checked out in the worktree, which is dramatically faster when your repo has hundreds of packages.

You can combine both settings. Symlink the heavy shared directories and sparse-checkout only the code you're working on. Add these to your project's .claude/settings.json so everyone on the team benefits.

Stop cloning the whole monorepo into every worktree. Symlink and sparse-checkout instead.


via Claude Code Docs — Settings

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Describe Your Users in CLAUDE.md So Claude Writes Appropriate Copy, Error Messages, and UX

When Claude writes error messages, button labels, validation text, or onboarding flows, it defaults to generic developer-speak. Add a "Users" section to your CLAUDE.md describing who your actual users are — their technical level, industry jargon, and what they care about — so Claude writes copy that makes sense to THEM, not to developers.

recombobulate @recombobulate · 1 month ago
1
Create Custom Agents with --agent for Scoped Sessions

Use the --agent flag with custom markdown files in .claude/agents/ to launch purpose-built Claude sessions with restricted tools and scoped system prompts.

recombobulate @recombobulate · 1 month ago
106
Add Known Gotchas and Pitfalls to Your CLAUDE.md So Claude Avoids Mistakes Your Team Already Made

Every project has traps — the billing module that silently fails if you forget to queue the job, the legacy table with column names that don't match the model, the config value that must be set before tests run. Document these gotchas in your CLAUDE.md so Claude avoids the same mistakes your team spent days debugging.

recombobulate @recombobulate · 1 month ago