Releases: CreatmanCEO/cc-janitor
Release list
v0.5.2
0.5.2 — Sessions tab UX overhaul + universal y clipboard yank (#11) * feat(tui): universal y clipboard yank binding + format helpers Adds YankMixin to every screen with a DataTable (Sessions, Perms, Context, Memory, Hooks, Schedule, Audit, Dream). `y` copies the highlighted cell (fallback: full row joined by tabs) via App.copy_to_clipboard (OSC 52) and shows a preview notification. Also introduces tui/_format.py with format_tokens, format_cost, relative_time, duration, short_id, strip_project_slug, topic_from_session, estimate_tokens_from_size — used by Sessions column reorg in the next commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(tui): Sessions tab column reorg + drill-down detail + action header Sessions tab UX overhaul (proof-of-concept for the pattern): - New columns left→right: Topic · Activity · Duration · Msgs · Tokens · Cost · ID · Project. Topic eats available width; Activity is relative (`2h ago`, `yesterday`, `Apr 14`); Duration shows started→last (`4h22m`, `1d3h`); Tokens uses size_bytes/4 estimate (O(1), no full re-read of jsonl); Cost shows $ at Opus input rate ($15/M). - ID truncated to 8 chars + `..`; full UUID lives in the new SessionDetailScreen and is copyable via `y`. - Header is action-oriented: `Sessions — N stored`, key map, plus a hint about the biggest session and a `cc-janitor session prune` tip. - Enter on a row pushes SessionDetailScreen (ModalScreen) with full metadata, all summaries, first/last user messages (truncated past 30 lines), and footer `d`/`r`/`y`/`Esc` actions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: bump to 0.5.2 + CHANGELOG Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(tests): bump version assertion to 0.5.2 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
v0.5.1 — TUI honesty + accurate skill cost
What's fixed
- TUI bindings actually fire on a fresh tab-switch. Every screen focuses its primary DataTable in
on_show, so per-tab keys (Sessionsd, Permsp/D, Schedulea/r/n/p, etc.) work without a hidden focus dance. - Sessions
dis real — preview + confirm modal + audit-logged soft-delete viacore.sessions.delete_session. - Perms
pandDare real — new preview modals for prune-stale and dedup, with bulkremove_rulecalls that back up each settings.json before write. - Schedule key naming is consistent across BINDINGS, header, F1 help and the empty-state CTA:
aadd,rremove,nrun-now,ppromote. - Skill cost is accurate.
enabled_skillsused to count full SKILL.md file size in tokens; now respectsskillListingMaxDescChars(default 1536) andskillOverrides("off","name-only") from~/.claude/settings.json. Heavy skills previously over-reported ~16x.
Dropped (sham bindings)
- Sessions
/search → usecc-janitor session find - Audit
uundo → usecc-janitor undo
Tests
319 passed (was 302). +17 new tests covering focus, sessions delete, perms preview modals, and skill cost calculation.
🤖 Generated with Claude Code
v0.5.0 — UX polish + TUI rendering fix
Highlights
Critical fix — TUI bodies no longer render empty
All 8 screens previously used height: NN% CSS, which Textual 8.2.5
collapses to 0 inside a TabPane. Every tab opened to an empty viewport.
Switched the screens and TabbedContent to 1fr fractional units;
DataTable and side panes now share remaining space correctly.
UX polish
- Per-screen header on every tab — a single Rich-markup line stating
what the tab shows and the key actions available. - Empty-state CTAs on Schedule (lists the 5 built-in templates),
Audit (shows thecc-janitor stats snapshotrecipe), and Dream
(explains the safety-net concept). - F1 tab-specific help modal — context-aware help for each tab.
- First-run Welcome modal with the 8-tab tour. Marker at
~/.cc-janitor/state/seen-welcomemakes it one-shot; re-display via
cc-janitor --tutorial. - Filter-by-scope labels next to the source-filter dropdowns on
Permissions / Memory / Hooks. - Inline column legends on Sessions (Msgs/Size) and Permissions
(Used90d, STALE/DUP). - Screen-level BINDINGS on every screen so Footer surfaces the
per-tab action keys.
Numbers
- 302 passing tests (was 290; +12 in
tests/tui/test_ux_polish.py) - All 4 CI jobs green (Ubuntu/Windows × Python 3.11/3.12)
Install / upgrade
pip install --upgrade cc-janitor
cc-janitor --tutorial # see the new Welcome tourSee CHANGELOG.md for the full diff.
v0.4.2 — Post-audit Critical fixes + docs polish
Critical findings closed (post-Phase-4 UX audit)
- C1 — tar compaction no longer orphans Dream pairs. Transparent
tar extraction indream diffanddream rollback;dream history
showsSTORAGEcolumn (dir / tar). - C2 —
backups pruneno longer eats Dream restore points.
~/.cc-janitor/backups/dream/partitioned off by default;
--include-dreamopts in with per-pair granularity.backups list
groups by[settings]/[dream]. - C3 — TUI hook-logging toggle works again. ConfirmModal +
tui_confirmed()wired inhooks_screen.action_toggle_logging
(silently failing since 0.3.2). - C4 — Memory TUI bindings cleaned up. Dropped unimplemented
e/m. Implementeda(archive, reversible viaundo) andf
(duplicate-line preview toggle). Final BINDINGS ={r, a, f}. - C5 —
stats sleep-hygieneexposes contradicting pair content.
Both JSON and text output now include subject + file list, not just
count.
Bonus
cc-janitor undoreversesdream rollback.cc-janitor config init [--force]scaffolds
~/.cc-janitor/config.tomlwith documented defaults.- Malformed
config.tomlnow warns to stderr instead of silently
falling back to defaults. - All 8 TUI tab labels routed through i18n.
dream rollbackdry-run warns about discarded post-snapshot dreams;
success message points tocc-janitor undo.
Documentation
- README.md drops outdated "not on PyPI" warning; install block uses
uv tool / pipx. Phase 4 section restructured. - README.ru.md fully resynced (was still describing Phase 1 only).
- docs/cookbook.md Phase-3 recipes reformatted to Problem / Commands /
Expected output / Next step style; sections renumbered. - docs/CC_USAGE.md updated with new commands and the dream-partition
guidance.
Tests
269 → 290 (+21 covering C1-C5 + bonus features). CI green on Ubuntu
3.11/3.12 and Windows 3.11/3.12.
Deferred to 0.4.3
dream doctor discoverability hint, doctor Dream / config.toml /
sys.platform rows, mutating Dream TUI actions, dream history WHEN
column, remaining I10/I11 (sessions/perms TUI write paths).
v0.4.1 — Windows console UTF-8 out-of-box fix
Fixed
- Windows out-of-box crash. Many subcommands (
session list,perms audit,hooks list, etc.) crashed withUnicodeEncodeError: 'charmap' codec can't encode characterswhen invoked on the default Windows console (cp1251 / cp866) against real Claude Code data containing Cyrillic / CJK / emoji paths.
Fixed by forcing sys.stdout.reconfigure(encoding="utf-8", errors="replace") at entry point on sys.platform == "win32". Users no longer need to set PYTHONIOENCODING=utf-8.
- New end-to-end test in
tests/unit/test_main_utf8.pyreproduces the failure on Windows by spawning a subprocess withPYTHONIOENCODINGunset; skipped on Linux CI.
Install / upgrade
pipx install --force cc-janitor==0.4.1
# or
uv tool install --force cc-janitor==0.4.1v0.4.0 — Phase 4: Dream safety net
Phase 4: Dream safety net
The first deterministic safety harness around Anthropic's Auto Dream. Snapshot before, diff after, roll back if needed.
Added — six features
- Dream snapshot harness.
cc-janitor dream history|diff|doctor|rollback|prune. Pre/post snapshots stored at~/.cc-janitor/backups/dream/<pair_id>-{pre,post}/, pairs recorded to~/.cc-janitor/dream-snapshots.jsonl. - Watcher
--dreammode.cc-janitor watch start --dreampolls every~/.claude/projects/*/memory/.consolidate-lockand writes a raw mirror around each Auto Dream cycle. cc-janitor dream doctor(10 checks). Stale.consolidate-lock, autoDream flag state, server-gate inference hint, last-dream timestamp, backup dir health + disk usage, MEMORY.md cap, memory file count, cross-file duplicate summary, settings-audit toggle warning.cc-janitor stats sleep-hygiene. Four keyword/regex/dup metrics: MEMORY.md size, relative-date density, cross-file duplicate count, contradicting-feedback pairs.cc-janitor backups tar-compact --kind dream+ new scheduler templatedream-tar-compact. Raw mirrors compacted to.tar.gzafter 7 days, tarballs purged after 30 days (thresholds configurable).- Settings-audit hook. Caches
~/.claude/settings.json:autoDreamEnabledat~/.cc-janitor/state/autodream-last-seen.json. On flip, writes an audit-log entry (cmd=settings-observe,mode=observer) and surfaces a WARN row incc-janitor dream doctor("settings autoDream toggled") asking the user to verify backups before the next Dream cycle.
Plus: 8th TUI tab (Dream) with snapshot list + diff viewer panes, optional ~/.cc-janitor/config.toml for tunable thresholds, i18n [dream] + [sleep_hygiene] tables (en + ru), three new cookbook recipes (#11 diff/rollback, #12 stale-lock diagnosis, #13 scheduled snapshot setup).
Fixed (upstream Claude Code issues)
- Closes #47959 — silent Auto Dream memory deletion
- Closes #50694 — stale
.consolidate-locksilently disables Auto Dream - Closes #38493 — missing
.dream-log.md - Closes #38461 — server-gate inference for Auto Dream flag
Stats
- 267 passing tests (+5 from Phase 3.3's 262)
- 5 new core modules:
dream_snapshot,dream_diff,dream_doctor,sleep_hygiene,settings_observer - 1 new CLI subapp (
dream), 1 new TUI screen, 1 new scheduler template - Zero new mandatory dependencies, zero Phase 1/2/3 regressions
Install
pipx install --force cc-janitor==0.4.0
# or
uv tool install cc-janitor==0.4.0
cc-janitor --version # → 0.4.0
cc-janitor dream doctor🤖 Generated with Claude Code
v0.3.3 — undo command + docs alignment
Closes C3 (undo) and C4 (docs/phantom-command alignment) from the 2026-05-11 UX audit. See CHANGELOG.md for details.
v0.3.2 — Critical safety fixes
Closes 3 Critical findings from the 2026-05-11 UX audit (C1/C2/C5). See CHANGELOG.md for details.
v0.3.1 — TUI Source-filter backend wire-up
Fixed
- TUI Source-filter dropdown now actually filters. In 0.3.0 the dropdown widget was added to Permissions / Hooks / Memory tabs but the underlying
discover_*()functions ignored scope. This patch wires it up end-to-end.
Changes
core.permissions.discover_rules(scope=...)accepts"real" | "nested" | "junk" | "real+nested" | "all"(or a concrete path), defaulting toNonefor everything.core.hooks.discover_hooks(scope=...)(+ aliasdiscover_hooks_files) ditto.core.memory.discover_memory_files(scope=...)ditto.- All three now also walk monorepo
.claude/locations undercwd()so nested/junk sources can actually be surfaced. - Sources are classified by enclosing
.claude/directory viacore.monorepo.classify_location(); canonical user paths (~/.claude/...) are treated as"real".
Added
- CLI parity:
cc-janitor perms list --scope,cc-janitor hooks list --scope,cc-janitor memory list --scope.
Tests
- 12 new scope-filter unit tests
- conftest now isolates cwd so monorepo discovery doesn't leak project fixtures
- 214 tests passing (up from 200)
See CHANGELOG.md for full details.
v0.3.0 — Phase 3: monorepo, watcher, stats, bundle, completions
Phase 3 MVP
Five new feature areas, taking cc-janitor from 0.2.0 → 0.3.0.
Monorepo nested .claude/ discovery
core/monorepo.pywalks a configurable root, classifies each location as real / nested / junkcc-janitor monorepo scan/show- TUI Source-filter dropdown on Permissions / Hooks / Memory tabs (widget; backend scope-aware filtering deferred to 0.3.1)
- Closes upstream issues anthropics/claude-code#37344, #35561, #18192, #40640
Opt-in auto-reinject watcher
core/watcher.pymtime-poll loop, cross-platform daemon spawn (start_new_sessionon POSIX,DETACHED_PROCESSon Windows)cc-janitor watch start/stop/status, health line incc-janitor doctor- Optional
psutilextra:pip install cc-janitor[watcher]
Stats dashboard with history
- Daily snapshots at
~/.cc-janitor/history/<date>.json cc-janitor stats [--since 30d] [--format text|json|csv]cc-janitor stats snapshot(called by Phase 2context-auditjob)- TUI Audit-tab stats sub-pane with ASCII sparklines (toggle:
s) context-auditscheduled-job template migrated to the new schema. Legacycost.jsonlstill readable.
Export/import config bundle
cc-janitor config export <bundle.tar.gz> [--include-memory]cc-janitor config import <bundle.tar.gz> [--dry-run] [--force]- Hard exclusion of
settings.local.json,.env,credentials.json - Dry-run-first guard; SHA-256 manifest verified on import; backup-before-overwrite
Shell completions
cc-janitor completions install [bash|zsh|fish|powershell]cc-janitor completions show <shell>
Quality
- 202 tests passing (up from ~160 in 0.2.0)
- Ruff-clean
- CI green on Python 3.11/3.12 × ubuntu/windows
Install
pip install cc-janitor==0.3.0
pip install cc-janitor[watcher]==0.3.0 # with optional psutil
Known limitations
TUI Source-filter widget renders + stores selection, but core
discover_rules / hooks_files / memory_files walk the full default
tree regardless of selection — backend wiring deferred to 0.3.1.
Migration note
Existing crontab entries referencing cc-janitor context cost --json
continue to work and are read by stats as legacy cost.jsonl. To
upgrade:
cc-janitor schedule remove cc-janitor-context-audit
cc-janitor schedule add context-audit
🤖 Generated with Claude Code