From chat-cleaner
Clean up unnecessary Claude Code chat files (.jsonl) across projects. Use when the user wants to delete rubbish/empty/failed chats, free up space, or tidy their Claude conversation history. Works locally and on remote hosts via SSH.
How this skill is triggered — by the user, by Claude, or both
Slash command
/chat-cleaner:chat-cleanupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Clean up unnecessary Claude Code chat history files across all projects.
Clean up unnecessary Claude Code chat history files across all projects.
Claude Code stores conversation history as .jsonl files in ~/.claude/projects/<project>/. Over time, these accumulate empty, failed, interrupted, and trivial sessions that waste space. This skill uses the claude-chat-cleaner CLI tool to analyze and clean them up.
The cleanup script is at: ${CLAUDE_PLUGIN_ROOT}/claude-chat-cleaner
If the plugin root variable is not available, fall back to: ~/.claude/skills/chat-cleanup/claude-chat-cleaner
Always start with a dry-run to show the user what would be deleted:
python3 ${CLAUDE_PLUGIN_ROOT}/claude-chat-cleaner --analyze
This will show a per-project breakdown of rubbish vs. useful chats with content previews.
Present the summary table and always ask before deleting. Never auto-delete.
Once the user confirms:
python3 ${CLAUDE_PLUGIN_ROOT}/claude-chat-cleaner --delete
To clean up a remote machine via SSH:
# First, copy the script to the remote host
scp ${CLAUDE_PLUGIN_ROOT}/claude-chat-cleaner <hostname>:~/claude-chat-cleaner
# Then run remotely
ssh <hostname> "python3 ~/claude-chat-cleaner --analyze"
ssh <hostname> "python3 ~/claude-chat-cleaner --delete"
--analyze Show what would be deleted (default, dry-run)
--delete Actually delete rubbish files
--project NAME Only process a specific project (substring match)
--min-size SIZE Only consider files under SIZE bytes (default: all files)
--json Output results as JSON for programmatic use
--claude-dir PATH Custom path to .claude directory (default: ~/.claude)
A chat is classified as rubbish if ANY of these are true:
Everything else is classified as keep.
.jsonl files in project directories--analyze mode makes zero changes — completely safe to runnpx claudepluginhub jainsvaibhav/claude-chat-cleaner --plugin chat-cleanerScans Claude Code config (skills, memory, hooks, permissions, MCP servers, caches) for stale or redundant items and walks the user through confirm-each-deletion cleanup.
Cleans Claude Code sessions in current project: lists recent ~/.claude/projects/<slug> .jsonl files in Markdown table with titles, mtimes, sizes, prompts; selects by number/sessionId, confirms before deleting files and attachments.
Manages Claude Code user config (~/.claude/) with actions for audit/status, backup/restore, cleanup sessions/agents/debug/logs, costs/storage/session-stats, history/transcript-search, plugin-reset, and more.