Skip to content

run: worktree cleanup destroys uncommitted deliverables when the lead ends BLOCKED #875

@kokevidaurre

Description

@kokevidaurre

What happened (2026-06-12, hq#464 redispatch — observed 3×)

Five squads ran the same red-team task. In three runs (company, engineering, intelligence) the LEAD wrote the deliverable to the run worktree (~/agents-squads/.worktrees/squads-run-<squad>-<id>-0), could not get approval for sandboxed git/gh writes, and ended STATUS: BLOCKED with 'run these 5 commands to finish'. The runner then removed the worktree — deleting the uncommitted memo with it. The deliverables were only recoverable by parsing Write tool calls out of the session JSONLs under ~/.claude/projects/.

Two squads in the same batch (research, customer) delegated the git/gh writes to a WORKER and self-delivered end-to-end — so the working pattern exists; the failure is leads doing the work themselves then dying blocked.

Two defects

  1. Data loss: run cleanup must not delete a worktree containing uncommitted/untracked changes. Options: skip cleanup and log the path when git status --porcelain is non-empty; or auto-commit to the run branch (squads/run-<id>) and push before removal — the branch is already namespaced, so this is safe.
  2. Convergence gap: a lead turn ending BLOCKED on write-approval should trigger one more cycle routing the listed write operations to a worker (workers demonstrably can perform them), instead of terminating the conversation.

Evidence

  • Transcripts: .agents/conversations/{company,engineering,intelligence}/ 2026-06-12 ~23:06Z (turns end STATUS: BLOCKED, worktree paths named)
  • Salvage commits note provenance: engineering#75, research#91, company#28
  • Contrast: research#90 + customer#44 — worker-delegated, landed without intervention

Related: hq#456 (comment-as-part-of-DONE), cli#872/#873 (empty-looking runs).

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions