Skip to content

fix(hooks): share cleanup across Claude and Codex, retain transcripts - #645

Closed
cdeust wants to merge 2 commits into
mainfrom
feat/session-worktree-cleanup
Closed

cdeust wants to merge 2 commits into
mainfrom
feat/session-worktree-cleanup

Conversation

@cdeust

@cdeust cdeust commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Fresh Claude Code and Codex sessions now retry cleanup of registered worktrees left by ended sessions. Both plugins invoke the existing shared disk-hygiene implementation. A verified pushed PR and preserved review evidence permit clean local worktree/branch removal; remote PRs and branches remain available.

Transcripts remain by default, including Claude subagent transcripts and file history. CORTEX_CLEANUP_TRANSCRIPTS=delete explicitly enables host-specific deletion checks. Codex SessionEnd persists independent retry intake within its native deadline, even while another cleanup owns the registry lock.

Validation and native host evidence are recorded in docs/validation/shared-cleanup-hooks-20260926.md. ADR-1092 documents the reused source and behavior. No merge or release is included.

Completion ledger: requirements and path-to-test evidence.

Validation: 109 focused tests passed with zero skips; repository Ruff lint/format,
craftsmanship, wiki mirrors and live marketplace pins passed. Native Claude and
Codex lifecycle dispatch and default retention were checked with a temporary
recorder; candidate installation/trust was not changed. The final Claude run hit
its session rate limit before Stop (Start/End passed); native Stop passed before
the interface-only refactor and the final manifest-command test passes. Independent safety review
approved after the regression fixes. The follow-up CI correction includes the cleanup hook in timing aggregation and updates the Codex bundle contract. The expanded local hook/script suite passed 1,839 tests and 378 subtests, with 27 skips. All applicable GitHub checks passed on commit 9a8b606b, including Python 3.10–3.13, SQLite, Windows, both fuzz jobs, and CI Green. The registered worktree, local branch, and test scratch were removed after push; review evidence remains in the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant