Skills
Claude Code worktree.sparsePaths + worktree.symlinkDirectories: Laser-Focused Monorepo Contexts That Check Out Only Relevant Directories
Also in v2.1.76, worktree.sparsePaths uses git sparse-checkout (cone mode) to write only specified directories to disk when spinning up agent worktrees — critical for large monorepos where full checkout is impractical. Pair with worktree.symlinkDirectories to symlink heavy dependency directories like node_modules from the main repo rather than copying. Agents working outside declared sparsePaths will fail to read those files, so declare task scope explicitly in settings.json.
Source
↳ Follow the thread