claude-cleaner 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +33 -10
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -65,6 +65,7 @@ claude-cleaner --version
65
65
 
66
66
  ```text
67
67
  --claude-dir <path> Custom Claude config directory (default: ~/.claude)
68
+ --dry-run Preview deletions without modifying any files
68
69
  --mock-update Simulate a newer version available (for testing the update flow)
69
70
  -h, --help Show help
70
71
  -v, --version Show version
@@ -75,14 +76,25 @@ claude-cleaner --version
75
76
  | Key | Action |
76
77
  | --- | --- |
77
78
  | `↑` / `↓` or `j` / `k` | Navigate list |
79
+ | `g` / `G` | Jump to top / bottom |
78
80
  | `space` | Toggle selection |
79
- | `enter` | Proceed show delete confirm (when items selected) |
80
- | `a` | Select all / deselect all |
81
- | `p` | Purge selected (confirm screen, purge mode) |
81
+ | `a` | Select / deselect all visible items |
82
+ | `n` | Unselect all |
83
+ | `o` | Select orphaned projects only |
84
+ | `enter` | Open Project Detail when nothing is selected; otherwise delete selected project session-history directories |
85
+ | `l` | Lock / unlock project (protected projects are skipped by destructive bulk actions) |
86
+ | `X` | Forget project: remove Claude session data + project metadata, never source code |
87
+ | `p` | Full purge selected projects through Claude CLI when available |
82
88
  | `x` | Force-purge item at cursor — no confirm |
89
+ | `s` | Cycle sort: recent / size / tokens / name |
90
+ | `f` | Cycle filter: all / has data / orphaned |
91
+ | `e` | Cycle expiry filter: off / 7 / 14 / 30 / 60 / 90 days |
92
+ | `/` | Search by project name or path |
93
+ | `c` | Open category cleanup |
83
94
  | `r` | Rescan / refresh project list |
84
95
  | `u` | Update claude-cleaner in-place (shown when update available) |
85
- | `esc` | Go back / cancel |
96
+ | `?` | Show key bindings |
97
+ | `esc` | Go back / clear search and filters / cancel |
86
98
  | `q` / `ctrl+c` | Quit (works on every screen) |
87
99
 
88
100
  ## Features
@@ -91,10 +103,18 @@ claude-cleaner --version
91
103
  - Displays **token usage** per project — reads `lastTotal*` fields from `~/.claude.json` when available, otherwise aggregates `message.usage` from session `.jsonl` files. Formatted as K / M / B / T / P / E.
92
104
  - Status column `●` (session files on disk) / `○` (config only, no local data).
93
105
  - Windows path dedup — `d:/foo` and `D:/foo` treated as the same project; higher-token entry wins.
106
+ - Project Detail screen with per-conversation JSONL session count, modified time, message count, token usage, and size.
107
+ - Delete individual conversation sessions without removing the entire project history.
108
+ - Protected Projects with `l`: locked projects are excluded from select-all, orphan selection, delete, purge, and forget operations.
109
+ - Forget Project with `X`: removes Claude-owned session data and the matching `~/.claude.json` project entry while preserving the real source project.
110
+ - Project list includes conversation/session counts alongside size, token usage, and last-modified time.
94
111
  - Multi-select with `space`, select all with `a`, confirm with `enter`.
95
- - Three deletion modes: session-files delete, full **purge** (via `claude project purge`), and instant **force-purge** (`x`).
112
+ - Separate deletion backends: normal **Delete** removes only the selected Claude session-history directory; **Purge** uses `claude project purge` when available and falls back to session-directory removal.
113
+ - `--dry-run` previews exactly which projects/categories would be cleaned without touching files.
114
+ - Search, sort, orphan filters, and age/expiry filters for large project lists.
115
+ - Category cleanup for disposable Claude data such as debug logs, telemetry, history, backups, and plugin **cache** while preserving plugin installation state.
96
116
  - Live progress bar during deletion.
97
- - Claude CLI integration tries `claude project purge` first, falls back to direct removal.
117
+ - Claude CLI integration is used only for explicit purge operations.
98
118
  - Auto update check against npm registry on startup; `u` to update in-place.
99
119
  - Claude CLI presence and version shown in header.
100
120
  - `r` to rescan at any time.
@@ -113,10 +133,13 @@ These folders contain Claude Code session and conversation history. Source code
113
133
 
114
134
  | Mode | Key | Confirm | Scope | How |
115
135
  | --- | --- | --- | --- | --- |
116
- | Delete | `enter` | ✓ screen | selected items | tries `claude project purge -y <path>`, falls back to `os.RemoveAll` |
117
- | Purge | `p` | ✓ screen | selected items | same as delete, confirm text emphasises full purge |
118
- | Force-purge | `x` | | cursor item only | same deletion chain, no confirm screen |
119
- | Delete all | `a` then `enter` | ✓ screen | all items | uses `claude project purge --all -y` (single call), then cleans remaining folders |
136
+ | Delete | `enter` with selected projects | ✓ screen | selected items | removes only the matching directory under `~/.claude/projects`; never invokes `claude project purge` |
137
+ | Delete conversation | Project Detail → `enter` | ✓ screen | selected JSONL sessions | removes only selected conversation files inside one project |
138
+ | Forget project | `X` | screen | current/selected projects | removes Claude session data and matching `~/.claude.json` metadata; source code is never touched |
139
+ | Purge | `p` | ✓ screen | selected items | runs `claude project purge -y <path>` when available; falls back to the matching session directory |
140
+ | Force-purge | `x` | ✗ | cursor item only | same purge chain as `p`, without a confirm screen |
141
+ | Delete all | `a` then `enter` | ✓ screen | all visible/selected items | deletes selected session directories individually; does not call `purge --all` |
142
+ | Purge all | `a` then `p` | ✓ screen | all projects | may use `claude project purge --all -y` for efficiency |
120
143
 
121
144
  All modes validate that the target path is inside the Claude projects directory before deleting.
122
145
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-cleaner",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Safely inspect and delete selected Claude Code project session history from an interactive cross-platform TUI.",
5
5
  "bin": {
6
6
  "claude-cleaner": "scripts/run.js"