You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
repo-hygiene: add an opt-in .work/ tidy mode #5222
A whole-machine cleanup reviewed 11 .work/ items across repos. Eight belonged to PRs that had already merged or issues that had already closed. Nothing in repo-hygiene looks at .work/, so they stay until someone attributes each one by hand.
Proposal
An opt-in mode of /repo-hygiene:clean (off by default) that tidies .work/:
Inventory every entry under .work/ (name, size, mtime).
Attribute each to its PR or issue (from the name, a marker file, or the branch that produced it) and report that PR or issue's state.
Once the PR merges or the issue closes, delete the entry or consolidate it into a uniform layout (for example .work/<issue-or-pr>/<artifact>), behind the usual confirmation gate.
Entries that cannot be attributed are listed and never deleted.
Why opt-in
.work/ is the gitignored place agents put backups and scratch, so an entry may be the only copy of something. The mode has to be requested, list what it would remove first, and leave unattributed entries alone.
Evidence
git grep -F ".work/" origin/main -- plugins/repo-hygiene returns nothing, so the skill has no notion of the directory. The batch forms (#994) cover caches, build output and git only.
.work directories (one under home, one per repo) accumulate handoffs, topic slices and scratch. session-flow defines their layout but no plugin cleans or normalizes them. disk-hygiene deliberately hints scratch* at low confidence only (baseline-policy.json, scratch-artifact), and repo-hygiene covers caches, build output and git, not .work.
Skills also drop scratch into .work with no lifecycle. In one session, /discovery:research run inline wrote its artifact to ~/.work/local-otel-claude-code, so other plugins' output lands in .work with nothing owning its cleanup.
Evidence
session-flow 0.38.26 owns the convention: reference/topic-docs.md:21-22 (handoffs in <memory_dir>/handoffs/, default .work/handoffs/; workflow-checklist.md in .work/<slug>/); memory root default .work at reference/structure.md:486 (MEMORY_ROOT="${MEMORY_ROOT:-.work}").
The only deletion in session-flow is the observer data under ${CLAUDE_PLUGIN_DATA}/session-flow-observer/, "deleted after the analysis run consumes them" (reference/topic-docs.md:33). No skill prunes .work.
An opt-in action (nothing runs unless invoked), for example /session-flow:tidy-work:
Inventory .work in the current repo and in home: per item, age, size, kind (handoff, checklist, slice, scratch, unknown).
In-flight detection: linked open issue or PR (from topic frontmatter or handoff), modified within N days, referenced by a later handoff or an unfinished checklist stage.
Actions: report, normalize (move to the standard layout, no deletion), clean (remove items that are not in flight, after listing the exact paths and one confirmation).
Anything unknown stays and is reported.
Proposed direction
Read-only report first (reuses the existing frontmatter and ledger parsers in scripts/save_point.py), clean second behind the shared confirmation pattern. It should call disk-hygiene's protection list rather than duplicating it if both are installed.
Activity
kyle-sexton commentedon Sep 29, 2026
Problem
.workdirectories (one under home, one per repo) accumulate handoffs, topic slices and scratch. session-flow defines their layout but no plugin cleans or normalizes them. disk-hygiene deliberately hintsscratch*atlowconfidence only (baseline-policy.json,scratch-artifact), and repo-hygiene covers caches, build output and git, not.work.Skills also drop scratch into
.workwith no lifecycle. In one session,/discovery:researchrun inline wrote its artifact to~/.work/local-otel-claude-code, so other plugins' output lands in.workwith nothing owning its cleanup.Evidence
reference/topic-docs.md:21-22(handoffs in<memory_dir>/handoffs/, default.work/handoffs/;workflow-checklist.mdin.work/<slug>/); memory root default.workatreference/structure.md:486(MEMORY_ROOT="${MEMORY_ROOT:-.work}").${CLAUDE_PLUGIN_DATA}/session-flow-observer/, "deleted after the analysis run consumes them" (reference/topic-docs.md:33). No skill prunes.work..worktopic-slice trees to tracker issues, which is the tracker link needed for in-flight detection.Expected
An opt-in action (nothing runs unless invoked), for example
/session-flow:tidy-work:.workin the current repo and in home: per item, age, size, kind (handoff, checklist, slice, scratch, unknown).report,normalize(move to the standard layout, no deletion),clean(remove items that are not in flight, after listing the exact paths and one confirmation).Proposed direction
Read-only
reportfirst (reuses the existing frontmatter and ledger parsers inscripts/save_point.py),cleansecond behind the shared confirmation pattern. It should call disk-hygiene's protection list rather than duplicating it if both are installed.Related: #3555, #4295 (closed, handoff fallback path), #4228.
🤖 Generated with Claude Code
https://claude.ai/code/session_01K3VkbjLqtYZ6JtsQaDKP4v
feat(session-flow): add tidy_work.py normalize and clean
feat(session-flow): add the tidy-work skill
docs(catalog): regenerate the catalog and cheat sheet for tidy-work
fix(session-flow): keep tracked, in-flight and concern state out of t…
test(session-flow): mark the declared-memory-dir eval as narration
feat(session-flow): attribute tidy-work scratch entries to the issue …
fix(session-flow): keep tidy-work items that hold a git checkout and …
fix(session-flow): make tidy_work.py executable
fix(session-flow): keep tidy-work report, normalize and clean in agre…
fix(session-flow): tidy-work clean keeps every item that names no iss…
feat(repo-hygiene): close fleet-wide and remote-branch gaps in clean (#…