When running git commit (and potentially other git operations) in repositories managed by Conductor, users may encounter:
Too many open files (os error 24)
The Conductor-managed repository accumulated 37 pack files in .git/objects/pack/ over time. Normal repositories have 1-3 pack files after garbage collection.
Each git operation requires opening all pack files simultaneously. Combined with:
- Multiple nested
.gitdirectories created by Conductor (observed in.conductor/*/and.conductor/*/workdir/) - Shell integrations like Powerlevel10k's
gitstatusdaemon that hold pack files open for prompt rendering - Multiple terminal sessions, each with their own gitstatus process
This exhausts the per-process file descriptor limit (default 256 on macOS).
Observed directory structure:
build-agent/
├── .git/ # Main repo - had 37 pack files
├── workdir/.git/
├── .conductor/
│ ├── washington-v1/.git/
│ ├── washington-v1/workdir/.git/
│ ├── toronto-v2/.git/
│ ├── toronto-v2/workdir/.git/
│ └── managua-v1/.git/
Pack file accumulation cause: Git creates new pack files during fetch, clone, and certain worktree operations. Without periodic garbage collection, these accumulate. Copying .git directories or creating worktrees from existing repos can inherit or create fragmented pack files.
-
Run
git gcafter worktree/clone operationsgit gc --auto # Lightweight, only runs if thresholds exceeded -
Run
git repackwhen setting up new workdirsgit repack -d -l # Consolidates packs, removes redundant ones -
Enable git maintenance in managed repos
git maintenance start # Sets up background maintenance scheduler -
Set aggressive auto-gc thresholds for managed repos
git config gc.autoPackLimit 10 # Default is 50 -
Consider using
git worktreeproperly instead of copying.gitdirectories, as worktrees share the parent repo's object store and don't create duplicate pack files. -
For long-running managed environments, consider periodic maintenance:
git maintenance run --task=gc
Running git gc --aggressive consolidated the 37 pack files down to 2, immediately resolving the issue.