Skip to content

Releases: CreatmanCEO/cc-janitor

v0.5.2

Choose a tag to compare

@github-actions github-actions released this 23 May 13:11
a5b908c
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

Choose a tag to compare

@CreatmanCEO CreatmanCEO released this 22 May 14:24
c294088

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 (Sessions d, Perms p/D, Schedule a/r/n/p, etc.) work without a hidden focus dance.
  • Sessions d is real — preview + confirm modal + audit-logged soft-delete via core.sessions.delete_session.
  • Perms p and D are real — new preview modals for prune-stale and dedup, with bulk remove_rule calls that back up each settings.json before write.
  • Schedule key naming is consistent across BINDINGS, header, F1 help and the empty-state CTA: a add, r remove, n run-now, p promote.
  • Skill cost is accurate. enabled_skills used to count full SKILL.md file size in tokens; now respects skillListingMaxDescChars (default 1536) and skillOverrides ("off", "name-only") from ~/.claude/settings.json. Heavy skills previously over-reported ~16x.

Dropped (sham bindings)

  • Sessions / search → use cc-janitor session find
  • Audit u undo → use cc-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

Choose a tag to compare

@CreatmanCEO CreatmanCEO released this 21 May 10:45
77e1e3a

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 the cc-janitor stats snapshot recipe), 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-welcome makes 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 tour

See CHANGELOG.md for the full diff.

v0.4.2 — Post-audit Critical fixes + docs polish

Choose a tag to compare

@CreatmanCEO CreatmanCEO released this 13 May 08:52
1f6912d

Critical findings closed (post-Phase-4 UX audit)

  • C1 — tar compaction no longer orphans Dream pairs. Transparent
    tar extraction in dream diff and dream rollback; dream history
    shows STORAGE column (dir / tar).
  • C2 — backups prune no longer eats Dream restore points.
    ~/.cc-janitor/backups/dream/ partitioned off by default;
    --include-dream opts in with per-pair granularity. backups list
    groups by [settings] / [dream].
  • C3 — TUI hook-logging toggle works again. ConfirmModal +
    tui_confirmed() wired in hooks_screen.action_toggle_logging
    (silently failing since 0.3.2).
  • C4 — Memory TUI bindings cleaned up. Dropped unimplemented
    e / m. Implemented a (archive, reversible via undo) and f
    (duplicate-line preview toggle). Final BINDINGS = {r, a, f}.
  • C5 — stats sleep-hygiene exposes contradicting pair content.
    Both JSON and text output now include subject + file list, not just
    count.

Bonus

  • cc-janitor undo reverses dream rollback.
  • cc-janitor config init [--force] scaffolds
    ~/.cc-janitor/config.toml with documented defaults.
  • Malformed config.toml now warns to stderr instead of silently
    falling back to defaults.
  • All 8 TUI tab labels routed through i18n.
  • dream rollback dry-run warns about discarded post-snapshot dreams;
    success message points to cc-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

Choose a tag to compare

@CreatmanCEO CreatmanCEO released this 13 May 08:06
6938546

Fixed

  • Windows out-of-box crash. Many subcommands (session list, perms audit, hooks list, etc.) crashed with UnicodeEncodeError: 'charmap' codec can't encode characters when 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.py reproduces the failure on Windows by spawning a subprocess with PYTHONIOENCODING unset; skipped on Linux CI.

Install / upgrade

pipx install --force cc-janitor==0.4.1
# or
uv tool install --force cc-janitor==0.4.1

v0.4.0 — Phase 4: Dream safety net

Choose a tag to compare

@CreatmanCEO CreatmanCEO released this 11 May 14:49
583603b

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 --dream mode. cc-janitor watch start --dream polls every ~/.claude/projects/*/memory/.consolidate-lock and 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 template dream-tar-compact. Raw mirrors compacted to .tar.gz after 7 days, tarballs purged after 30 days (thresholds configurable).
  • Settings-audit hook. Caches ~/.claude/settings.json:autoDreamEnabled at ~/.cc-janitor/state/autodream-last-seen.json. On flip, writes an audit-log entry (cmd=settings-observe, mode=observer) and surfaces a WARN row in cc-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-lock silently 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

Choose a tag to compare

@CreatmanCEO CreatmanCEO released this 11 May 13:37
9cd7b8d

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

Choose a tag to compare

@CreatmanCEO CreatmanCEO released this 11 May 13:27
24dc26e

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

Choose a tag to compare

@CreatmanCEO CreatmanCEO released this 11 May 13:08
17520f5

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 to None for everything.
  • core.hooks.discover_hooks(scope=...) (+ alias discover_hooks_files) ditto.
  • core.memory.discover_memory_files(scope=...) ditto.
  • All three now also walk monorepo .claude/ locations under cwd() so nested/junk sources can actually be surfaced.
  • Sources are classified by enclosing .claude/ directory via core.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

Choose a tag to compare

@CreatmanCEO CreatmanCEO released this 11 May 12:49
8822cd5

Phase 3 MVP

Five new feature areas, taking cc-janitor from 0.2.0 → 0.3.0.

Monorepo nested .claude/ discovery

  • core/monorepo.py walks a configurable root, classifies each location as real / nested / junk
  • cc-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.py mtime-poll loop, cross-platform daemon spawn (start_new_session on POSIX, DETACHED_PROCESS on Windows)
  • cc-janitor watch start/stop/status, health line in cc-janitor doctor
  • Optional psutil extra: 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 2 context-audit job)
  • TUI Audit-tab stats sub-pane with ASCII sparklines (toggle: s)
  • context-audit scheduled-job template migrated to the new schema. Legacy cost.jsonl still 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