You're offline — showing cached data

Daily broad worktree cleanup across workspace + PKA + mission-control (incl. kanban-worktrees)

worktree-reaper
2026-06-13 06:09:20 SAST
← Back to Tasks

Weekly (Sunday 04:30 SAST). Broad sweep across both repos — complements the daily cleanup-stale-worktrees task by also covering PKA/.claude/worktrees/ and orphan worktrees that have no matching MC ticket.

Auto-prunes any worktree that is BOTH clean (no uncommitted changes, zero commits ahead of master) AND either has a done/cancelled ticket or has no linked ticket at all. Open tickets (inbox / in_progress / needs_input / in_review) are left alone even when empty — a worker may just not have committed yet. The current working directory is never pruned.

Run in report mode for a survey: python3 ~/workspace/scripts/worktree-reaper.py — prints a table with ticket id, status, age, commits ahead, uncommitted count, size and verdict. Add --json for machine-readable output.

Logs to ~/workspace/logs/worktree-reaper.log — one line per run with scanned/safe/manual/removed/failed counts and MB freed.

Created 2026-04-20 from MC-1050 (follow-up to MC-1037).

Daily at 04:3030 4 * * *
Yes
shell
900s
No
in 22h (2026-06-14 04:30)

Task Definition

tasks/worktree-reaper.md
shell
set
No
No
/usr/bin/python3 /home/lucienne/workspace/scripts/worktree-reaper.py --prune --quiet

Edit Schedule

Result:
4
Runs (7d)
4
Completed
0
Failed
0
Timeout
100%
Success (7d)
3s
Avg Duration
infrastructure maintenance disk

Run History (4)

StartedFinishedStatusDurationOutputLog
2h ago 2h ago completed 5s
View log
1d ago 1d ago completed 5s
View log
2d ago 2d ago completed 1s
View log
6d ago 6d ago completed 3s
View log

Comments (0)

No comments yet — add instructions for Luci
Help