Only run if needed: `git gc --auto` — checks heuristics and exits immediately if nothing is overdue.
Aggressive repack (rarely worth it, much slower): `git gc --aggressive`.
Force a run even if another gc is active: `git gc --force`.
Control how old loose objects get pruned: `git gc --prune=now` (increases risk if another process writes concurrently) or `--no-prune`.
Known gotchas
git gc --auto runs automatically after many porcelain commands that grow the repo (gc.auto threshold ≈6700 loose objects); don't over-trigger it manually.
--aggressive recomputes all deltas and is usually not worth the time — the docs explicitly recommend against it without benchmarks.
--prune=now discards unreachable objects of any age and can corrupt concurrent operations; default prune age is 2 weeks.
Unreachable objects are now packed into a cruft pack by default (gc.cruftPacks); don't expect loose objects to vanish into thin air.
Give your agent this knowledge — and 17,000+ more routes
One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?