Skip to content

Free build and worktree resources at the step that ends their use #2979

Open

Description

@josecelano-bot

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:

  1. A principle in AGENTS.md: free resources at the phase that ends their use.
  2. A close-out step (in create-feature-branch and 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 only target/.
  3. Replace the "clean stale files periodically" lines in the four skills with a real step or a pointer to it.
  4. Optional: delete the temporary branch in the two updater skills.
  5. A note in docs/git-hooks.md on copied or renamed checkouts with a stale target/.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions