Skip to content
Original
Tutorials宝玉 · X· @dotey·· 2 hours ago

1.8K views · 8 likes · 2 reposts (at collection)

Baoyu Recommends AGENTS.md Rules to Clean Up Worktrees

Who
Dotey
What
recommends adding rules to AGENTS.md requiring agents to clean up worktrees when tasks are complete

What happened

Baoyu recommends adding a rule to AGENTS.md that requires agents to remove worktrees and their branches when tasks finish. The linked rule says to either merge the work or commit unmerged changes and tag them for archival before removal; the orchestrating subagent session is responsible for cleaning up worktrees it created.

Read next

See the full storyBaoyu recommends AGENTS.md rules requiring agents to clean up worktrees and branches

The story so far

Baoyu (Dotey) recommends adding rules to AGENTS.md that require agents to remove worktrees and their branches when tasks finish, with cleanup assigned to the orchestrating subagent session that created them. The linked rule calls for preserving the work before removal: agents should either merge it or commit unmerged changes and tag them for archival.

Keep up with AI, one email a day

Model releases, price changes and compute developments, with original sources. Free, confirmed by email, and easy to unsubscribe. Read a past issue · 2026-10-28