claw-clean
v1.2.3
Published
Interactive session cleanup tool for OpenClaw — TUI menu with arrow-key navigation and orphaned session detection
Maintainers
Readme
claw-clean
Interactive session cleanup tool for OpenClaw.
Features
- TUI menu with arrow-key navigation (inspired by
@clack/prompts) - Selectable sessions — each session listed with full UUID + identifier
- Smooth cursor — only updates changed lines, no full redraw
- Space to toggle, Enter to execute
- Auto-detected trash command — works with
trash,trash-put, orgio trash - Cleans trajectory companions alongside selected sessions
- Stale data cleanup —
.deleted,.bak-*,archive/ - Cleans
sessions.json— removes deleted and orphaned session references - Color-coded status — OPEN (red), active (green), orphaned (yellow), inactive (default)
Installation
npm install -g claw-cleanOr use directly:
npx claw-cleanUsage
claw-clean # interactive menu
claw-clean -a dashboard # target another agent
claw-clean -h # helpInteractive Controls
| Key | Action |
|-----|--------|
| ↑ / ↓ | Navigate sessions |
| Space | Toggle selection (○ ↔ ●) |
| Enter | Execute selected items |
| q / Ctrl+C | Quit without doing anything |
What It Cleans
Regular sessions:
- The
.jsonlsession file - Its
.trajectory.jsonlcompanion - Its
.trajectory-path.jsoncompanion - Entry removed from
sessions.json
Orphaned sessions (in sessions.json but file missing):
- Entry removed from
sessions.jsononly (no file to trash)
Stale data:
.deleted.*files + their trajectory companions.bak-*backup filesarchive/folder
Requirements
bash(4.0+)- One of:
trash(trash-cli),trash-put, orgio trash jq(optional, forsessions.jsoncleanup)
License
GPL-3.0
