Support opt-in sparse checkout when creating managed worktrees

Open 💬 1 comment Opened Jul 30, 2026 by shezchen

What variant of Codex are you using?

App

What feature would you like to see?

Please add a Codex config setting that enables sparse checkout for newly created managed worktrees.

The setting should be disabled by default. When enabled, Codex should prompt the user to select one or more repository directories before creating a new worktree, then materialize only those selected paths.

The sparse selection should be applied during creation, rather than creating a full worktree first and converting it afterward. When the setting is disabled, the current full-checkout behavior should remain unchanged.

Additional information

My GameDev repository is over 300 MB, with most of its size coming from game assets. For many Codex tasks, I only need the source-code directory and do not need textures, audio, models, or other assets.

Creating a full managed worktree is therefore unnecessarily slow and consumes significant disk space. An opt-in directory picker would make worktree-based and parallel workflows much more practical for large Game projects and monorepos.

View original on GitHub ↗

1 Comment

shezchen · 29 days ago

Additional clarification,a Local Environment setup script can run git sparse-checkout after a managed worktree is created. I verified the creation sequence on Codex App for Windows: It seems that Codex first runs git worktree add --detach <path> <ref> without --no-checkout, and only then runs the selected setup script.

Therefore, for a normal non-sparse source checkout, all tracked files are materialized before the script narrows the worktree. This workaround can reduce steady-state disk usage, but it does not avoid the initial full checkout, creation time, or peak disk usage. It also uses a predefined project script rather than allowing paths to be selected per worktree.

This request is specifically for sparse paths to be selected and applied before file materialization when creating each new managed worktree.