chat-cleaner
Skill7 starsChanged 4 months agoMITView on GitHub
Map, name, and triage agent chat/conversation history. Finds sessions to delete, renames unnamed ones, and produces a clean inventory. Especially useful in Claude Code and similar tools where chat history accumulates silently.
In this repository14 other files it gives its agents.
- artifactSkill
- clean-systemSkill
- doc-styleSkill
- dumb-downSkill
- experiment-workflowSkill
- first-principlesSkill
- gitlabSkill
- harness-engSkill
- pdfSkill
- product-designSkill
- req-engineeringSkill
- training-nnSkill
- visionSkill
- word-farsi-docxSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Run a targeted find first — do not scan the whole filesystem:
- Distinctive: line 51
Do NOT auto-delete. Present the list to the user and wait for confirmation.
- Distinctive: line 62
Only after explicit user approval per session or per batch:
- Distinctive: line 80
Never delete the current active session.
- Distinctive: line 81
If session files are in a format you can't parse, report the path and format — don't guess.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Chat Cleaner
Agent conversation history accumulates fast. Unnamed sessions, abandoned experiments, and duplicate threads create noise and make it hard to find what matters. This skill maps and cleans it.
Step 1 — Locate chat storage
Common locations by tool (check which apply):
| Tool | Default chat location |
| Claude Code | ~/.claude/ or project-local .claude/ |
| Antigravity / AGY | ~/.gemini/antigravity-cli/brain/ |
| Codex | ~/.codex/ or per-project .codex/ |
| Generic | ~/.config/<tool>/history/, ~/.local/share/<tool>/ |
Run a targeted find first — do not scan the whole filesystem:
find ~/.claude ~/.gemini ~/.codex -maxdepth 3 \( -name "*.json" -o -name "*.jsonl" \) 2>/dev/null | head -40Step 2 — Map sessions
For each session file found, extract:
- ID (filename or internal ID)
- First user message — best proxy for what the session was about
- Last activity timestamp
- Message count — rough proxy for depth
- Named? — does it have a human-readable title or is it a raw UUID?
Output a table:
| ID (short) | Name / First message | Last active | Messages | Keep? |
Step 3 — Flag deletion candidates
Mark a session for deletion if:
- Zero or one user message (abandoned before anything happened)
- Last activity > 90 days ago with < 5 messages
- Exact duplicate first message as another session (likely re-runs)
- Name is a raw UUID and content is trivial (single greeting, test message)
Do NOT auto-delete. Present the list to the user and wait for confirmation.
Step 4 — Name unnamed sessions
For sessions worth keeping but without a human name:
- Derive a short name (3–6 words) from the first meaningful user message.
- Propose the name; apply only after user confirms or says "go ahead."
Step 5 — Delete confirmed sessions
Only after explicit user approval per session or per batch:
rm <path-to-session-file>Report what was deleted. Never delete without confirmation.
Output format
Produce a clean markdown summary:
- Kept: N sessions (list with proposed names if renamed)
- Deleted: N sessions (list with reason)
- Skipped / needs review: any ambiguous cases
Caution
- Never delete the current active session.
- If session files are in a format you can't parse, report the path and format — don't guess.
- Chat history may contain keys, tokens, or personal data. Keep all operations local.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

