10 Working Folders Removed, 10 Branches Preserved

One project, several similar folders

I had created one project, yet several similarly named folders appeared beside it. Their names did not tell me which was the main copy or what could be removed. I asked AI to investigate and report a plan before taking any cleanup action.

It found one main working folder, ten additional Git worktrees, and one stale registration whose folder was gone. A worktree provides a separate working directory for a branch in the same repository. These folders were not necessarily disposable duplicates.

The investigation did not establish who had created them. The useful next step was to inspect the work they contained.

Three checks before cleanup

AI’s report separated uncommitted changes, differences from the main branch, and data outside Git’s tracking.

Check Reported finding Implication
Uncommitted code changes and new files None No uncommitted work found only in the folders
Unique changes relative to the main branch Present on six branches Preserve the branches containing those changes
The other four branches No unique patches relative to main Distinguish these from the six with differences
Ignored files and user data Caches only; user-data folders empty Check more than Git’s tracked-file status

A clean working directory would not have answered all of these questions. No uncommitted changes can mean that the work has already been committed. Six branches did contain work that differed from the main branch.

Remove the folders, preserve the branches

After receiving the plan, I told AI to proceed. Its final report said it had removed ten worktree folders and pruned the stale registration, while preserving all ten branches and their commits. Only the main working folder remained, and the repository was reported clean.

The final check covered both removal and preservation: whether the ten branches still existed and whether the main working folder had acquired any changes.

Separating investigation from execution gave the cleanup a defined scope. AI mapped the folders, compared their contents, and performed the cleanup. I required the plan first, then instructed it to execute. The resulting state reduced the number of working folders without discarding the code differences available for later review.

The counts and results come from the investigation and completion reports of August 27, 2026. I did not reinspect or delete anything in that repository while writing this article. Project and branch names are omitted.

On this page