Who cleans up coding agents' branches and worktrees? Assay shares a workflow
fuckme · reddit · 2026-10-11
With agentic development, multiple coding agents create branches, checkpoint commits and worktrees all day. After a PR merges, local branches, review checkouts and recovery records linger: leftover worktrees eat disk, and tools scanning refs or walking retained history have more to process (though an old branch doesn't slow every Git command).
Building Assay, the author found it helps to separate three jobs:
- Merge the change: get accepted work onto main.
- Retire the workspace: check for active owners, unpublished work and evidence before removing worktrees and branches.
- Maintain the repository: let Git pack objects and maintain indexes while keeping a sensible recovery window.
Squash merging keeps accepted history concise, but original task commits survive while branches, worktree HEADs or reflogs retain them.
Starting inventory commands:
bash
git worktree list --porcelain
git branch -vv
git count-objects -vH
Assay is building ownership checks, workspace retirement and maintenance into its agent-work management tools — practices useful even with plain shell scripts. Open question: what should signal a workspace is safe to retire — merged PR, completed review, retention period, or explicit owner sign-off?
Related event: Assay Team Shares Git Worktree Cleanup Workflow for Multi-Agent Development(2 posts)→
More from coding & agent
- 10 GitHub repos that stop your AI agent from leaking keys and personal data — victor_explore · 2026-10-11
- Dev in prod: running a newsletter side project on a cheap persistent VM — davidcrawshaw · 2026-10-11
- AI assistant fixes GNOME dock broken by major update in about an hour — Moarkush · 2026-10-11
- GitHub CEO shares his Vibe Coding experiment building a game engine — zeeg · 2026-10-11
- DeepSeek Bot: open-source plugin turns DeepSeek Harness into persistent multi-bot teams — teortaxesTex · 2026-10-11
- 4K/60fps music visualizer coded and rendered entirely via ChatGPT — most_triumphant_yeah · 2026-10-11