Description
Parent EPIC: #2003 - Overhaul: Automation Tools and AI Agent Guardrails
Goal
Make contributors and agents free build and worktree resources at the step that ends their use, instead of "periodically".
Problem
On 2026-11-10 about 555 GB of old target/ directories in finished agent worktrees filled the maintainer's disk. Checked on develop at 7bc30738a: no skill, and neither AGENTS.md nor docs/git-hooks.md, mentions cargo clean or git worktree. Four skills only say to clean stale files "periodically" (push-changes, run-pre-commit-checks, and run-pre-push-checks twice), which no step enforces.
A related failure: a copied or renamed checkout with a stale target/ kept a stale CARGO_BIN_EXE_* path, and the merge script's pre-push failed (a follow-up of #2714).
Proposed scope
To settle in the specification:
- A principle in
AGENTS.md: free resources at the phase that ends their use. - A close-out step (in
create-feature-branchand in the issue close-out description):cargo clean, and remove the worktree only when its status is clean, no commit is missing from every remote branch and no process uses it; otherwise clean onlytarget/. - Replace the "clean stale files periodically" lines in the four skills with a real step or a pointer to it.
- Optional: delete the temporary branch in the two updater skills.
- A note in
docs/git-hooks.mdon copied or renamed checkouts with a staletarget/.
Out of scope: a cleanup command the maintainer triggers himself across checkouts; that stays in his own tooling.
Notes
- Not started. The order among the sub-issues is decided when a slot is free. The specification and the EPIC table row are written when the work starts.
- Filed by the EPIC Overhaul: Automation Tools and AI Agent Guardrails #2003 coordinator session (AI assistant, Claude Code) on 2026-11-19 at the maintainer's request, so the idea is not lost. The details were recovered from that session's earlier notes; the specification must check them again.
Activity