Answer: Set the `worktree.sparsePaths` setting to list the directories you need; git sparse-checkout then writes only those listed directories plus root-level files to disk. Commit it to `.claude/settings.json` if everyone needs the same paths, or use `.claude/settings.local.json` to add paths for yourself. Status: Confirmed Entry: tool/claude-code/features/sparse-worktrees-checkout-directories Revision: 1 Digest: sha256:af1803015a777b5d (changes whenever the content changes) Timeline: Created: 2026-11-13T03:04:29Z Last changed: 2026-11-13T03:04:29Z Last verified: 2026-11-20T12:21:38Z Next check: 2026-11-21T12:21:38Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of setting name | worktree.sparsePaths | [1] | 2026-11-20 committed settings file | .claude/settings.json | [1] | 2026-11-20 local settings file | .claude/settings.local.json | [1] | 2026-11-20 example sparse path 1 | .claude | [1] | 2026-11-20 example sparse path 2 | packages/api | [1] | 2026-11-20 example sparse path 3 | packages/shared | [1] | 2026-11-20 path base | relative to the repository root | [1] | 2026-11-20 symlink companion setting | symlinkDirectories | [1] | 2026-11-20 Sources: [1] Anthropic. "Set up Claude Code in a monorepo or large codebase". https://code.claude.com/docs/en/large-codebases.md Role: primary. Accessed: 2026-11-20T12:21:38Z Quote: "the `worktree.sparsePaths` setting uses git sparse-checkout to write only the listed directories plus root-level files to disk" (Supports: setting name) Quote: "If everyone working in this directory needs the same paths, commit the setting to `.claude/settings.json`." (Supports: committed settings file) Quote: "To add paths for yourself, use `.claude/settings.local.json`" (Supports: local settings file) Quote: ""sparsePaths": [ ".claude"," (Supports: example sparse path 1) Quote: ""packages/api"," (Supports: example sparse path 2) Quote: ""packages/shared"" (Supports: example sparse path 3) Quote: "Paths in `sparsePaths` are relative to the repository root, regardless of which subdirectory you start Claude from." (Supports: path base) Quote: "pair `sparsePaths` with `symlinkDirectories` in the same `.claude/settings.json`" (Supports: symlink companion setting) Published: 2026-11-20T02:54:02Z Snapshot SHA-256: f5d723ccd1962a060db8f6b5991b4e98d8d0623bfbd75ff9dab2d1d62870d8d9 (captured 2026-11-20T12:21:36Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-20T12:21:38Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:21:38Z Last attempt: 2026-11-20T12:21:38Z Notes and limitations: Extracted automatically from a single official source (section "Check out only the directories you need"). Related: https://latestn.com/tool/claude-code/features/start-session-in-worktree How do I start a Claude Code session in a git worktree using the --worktree flag? https://latestn.com/tool/claude-code/features/status-line-data-fields What data fields are available to a Claude Code status line script? https://latestn.com/tool/claude-code/features/thirty-day-playbook What is a thirty-day plan for rolling out Claude Code on my team? https://latestn.com/tool/claude-code/features/scan-only-changes How do I scan only my changes or a pull request diff for vulnerabilities in Claude Code? https://latestn.com/tool/claude-code/features/session-own-worktree How do I run a Claude Code Desktop session in its own Git worktree? https://latestn.com/tool/claude-code/features/share-artifact How do I share a Claude Code artifact with my organization or a public link? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:04:29Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/features/sparse-worktrees-checkout-directories/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/features/sparse-worktrees-checkout-directories POST: https://latestn.com/dispute/tool/claude-code/features/sparse-worktrees-checkout-directories with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/features/sparse-worktrees-checkout-directories?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I set up sparse worktrees in Claude Code to check out only needed directories? Revision 1, last verified 2026-11-20T12:21:38Z. https://latestn.com/tool/claude-code/features/sparse-worktrees-checkout-directories (accessed 2026-11-21T10:00:27Z). @misc{LatestN_tool_claude_code_features_sparse_worktrees_checkout_directories_r1, title = {How do I set up sparse worktrees in Claude Code to check out only needed directories?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/features/sparse-worktrees-checkout-directories}}, note = {Revision 1; digest sha256:af1803015a777b5d; last verified 2026-11-20T12:21:38Z; accessed 2026-11-21T10:00:27Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/features/sparse-worktrees-checkout-directories