fix: smart legacy ~/GitHub detection based on worktree layout#986
Merged
web3dev1337 merged 1 commit intomainfrom Mar 21, 2026
Merged
fix: smart legacy ~/GitHub detection based on worktree layout#986web3dev1337 merged 1 commit intomainfrom
web3dev1337 merged 1 commit intomainfrom
Conversation
bootstrapProjectsRoot() previously fell back to ~/GitHub any time it had visible entries, even if every repo was a flat clone with no master/ subdirectory. This caused worktree creation to fail on machines where ~/GitHub existed but repos weren't in the worktree layout. Now recursively scans (depth-limited to 8, stops at repo boundaries) to find repos and count how many use worktree layout (master/.git or main/.git) vs flat clones (.git at root). Skips grandfathering when zero repos use worktree layout or when less than 25% of 4+ repos do. New repos get created under ~/.agent-workspace/projects/ with proper layout instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
54751e0 to
fc83923
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bootstrapProjectsRoot()previously grandfathered~/GitHubas the projects root whenever it had ANY visible entries, even flat clones~/GitHubfull of flat clones (nomaster/subdirectory), this caused worktree creation to fail with "missing master/main directory"~/GitHub(up to 6 levels deep, max 200 dirs) to detect repos and count how many use worktree layout~/GitHub/games/hytopia/games/PROJECT/master/.gitTest plan
~/GitHubfull of flat clones → should use~/.agent-workspace/projects/instead~/GitHubusing worktree layout (like your Linux) → should keep using~/GitHub~/GitHub→ should use~/.agent-workspace/projects/🤖 Generated with Claude Code