Skip to content

Feature Request: Sparse Checkout Support for Large Repos (Unity/Game Dev) #819

@EyeSeeEm

Description

@EyeSeeEm

Problem

Worktree creation fails or takes extremely long on large game projects (Unity, Unreal, Godot).

My test case: Unity project with 85,000+ files / 22GB

  • Worktree checkout times out or fails with fatal: Could not reset index file to revision 'HEAD' on Windows
  • Even when it works, checking out 33,000+ files takes several minutes per worktree
  • Windows Defender and file locking exacerbate the issue

Proposed Solution

Support git sparse-checkout when creating worktrees. For code-focused tasks, only checkout source code directories, not binary assets.

How it works

git worktree add --no-checkout ../worktree-name branch
cd ../worktree-name
git sparse-checkout init --cone
git sparse-checkout set Assets/Scripts Assets/ScriptableObjects ProjectSettings Packages
git checkout

Results from my testing (GalacticGlitch Unity project)

Metric Full Checkout Sparse Checkout Improvement
Files 85,404 4,622 95% fewer
Disk Space 22 GB 26 MB 99.9% smaller
Checkout Time Minutes (often fails) Seconds ~100x faster

All code files needed for development tasks are present in the sparse checkout.

Suggested UX

Option A - Auto-detection:

  • Detect large repos (>10K files or >1GB)
  • Automatically offer/enable sparse checkout with sensible defaults

Option B - Project configuration:

  • Allow users to configure sparse-checkout patterns in project settings
  • Provide presets for common project types (Unity, Unreal, Godot, etc.)

Option C - Per-task configuration:

  • Let users specify which directories are needed for a specific task
  • AI could potentially infer required directories from the task description

Unity-specific defaults

Assets/Scripts
Assets/ScriptableObjects
Assets/Editor
ProjectSettings
Packages

This would make Auto-Claude viable for game development projects, which are often the largest and most complex codebases.

Environment

  • Windows 11
  • Git 2.x
  • Auto-Claude v2.7.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions