v0.2.0 — Phase 2: memory editor, reinject, hooks debugger, scheduler
Summary
Phase 2 of the cc-janitor roadmap. 18 TDD tasks, 50+ new tests, 152 passing total. Cross-platform (Linux/macOS/Windows) on Python 3.11 + 3.12.
Modules added
- Memory —
cc-janitor memory list/show/edit/archive/move-type/find-duplicates. Frontmatter parsing, type classification (user/feedback/project/reference/unknown), duplicate-line detection across files. TUI Memory tab. - Reinject —
cc-janitor context reinject [--memory] [--claude-md]writes a marker; the PreToolUse hook (Phase 1install-hooks) reads it and emits a<system-reminder>block to re-read CLAUDE.md / memory mid-session.install-hooksnow generates a PowerShell branch on Windows alongside POSIX shell. - Hooks debugger —
cc-janitor hooks list/show/simulate/enable-logging/disable-logging/validate. Merged view across user/user-local/project/project-local settings layers, schema validation, simulate with realistic stdin payloads (9 events), reversible logging wrapper using a sentinel marker. TUI Hooks tab. - Scheduler —
cc-janitor schedule list/add/remove/run/promote.SchedulerABC withCronScheduler(Linux/macOS) andSchtasksScheduler(Windows). 5 templates: perms-prune, trash-cleanup, session-prune, context-audit, backup-rotate. First run afteraddis forced--dry-run;promoteflips it live. - Safety hard cap — when
CC_JANITOR_SCHEDULED=1, refuses to delete more thanCC_JANITOR_HARD_CAPitems per run (default 200), raisingRunawayCapError.
Closes upstream Issues
- #29746 (memory not re-read after context continuation) — via reinject hook
- #11544 + #10401 + #16564 (hooks debugging broken) — via hooks debugger + simulate + Windows env-var fix
- #2766 (large CLAUDE.md performance) — via memory editor with disable-toggle (groundwork)
Install
pip install cc-janitor==0.2.0🤖 Generated with Claude Code