Vibe coding pitfall: agents leaving code in unmerged worktrees — with cleanup prompts and AGENTS.md rules
dotey · x · 2026-09-15
A hands-on vibe coding pitfall: tasks marked complete by coding agents turned out to be sitting in git worktrees, never merged back to main — only discovered during later testing.
Reusable materials shared:
- Review prompt: find worktrees not synced to main; list branch, change summary (recent commits) and the session that created it
- Cleanup prompt: merge clearly worthwhile worktrees and remove them; flag uncertain ones with recommendations for human confirmation
- AGENTS.md rule: no leftover worktrees — on completion either merge to main, or commit changes, tag as archive/<worktree>, then git worktree remove + git branch -D; the orchestrating session handles cleanup; anything kept must be named with path and reason
Lesson: don't ban worktrees — use rules to guarantee nothing gets lost.
More from coding & agent
- Solo dev argues LLMs shouldn't be the default center of an agent runtime — HmmmThisIsOdd · 2026-09-15
- How Much Code Is Throwaway Now? Engineers Rethink Project Lifespans in the AI Era — rakyll · 2026-09-15
- Translation MCP team: the hard part wasn't the server, it was getting the model to call it — Pure-Ad7786 · 2026-09-15
- Developer runs Claude inside Siri on macOS 27 via Apple's hidden model-provider support, open-sourced — Teknium · 2026-09-15
- OpenResearch tops GitHub trending, turns Claude Code and Codex into research agents — TheMoonMidas · 2026-09-15
- CoreSpeed Launches: One MCP Endpoint for Tools, Memory and Agent Budgets — Kind-Atmosphere9655 · 2026-09-15