claude-cleanup
/claude-cleanup
Use when the user says "clean up claude.json", "remove stale projects", "prune old project entries", "clean up my Claude project history", or wants to remove project entries from ~/.claude.json whose directories no longer exist on disk.
- Author
- gchiam ↗
- Repository
- claude-code-plugins ↗
- Licence
- MIT
- Last repository change
- 22.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Use when the user says "clean up claude.json", "remove stale projects", "prune old project entries", "clean up my Claude project history", or wants to remove project entries from ~/.claude.json whose directories no longer exist on disk.
Triggers from the description
Original author description
Use when the user says "clean up claude.json", "remove stale projects", "prune old project entries", "clean up my Claude project history", or wants to remove project entries from ~/.claude.json whose directories no longer exist on disk.
How it works
- When NOT to Use
- Rules
- Setup: Resolve the script path
- Phase 1 — Scan
- Phase 2 — Insights prompt
- Phase 3 — Insights (conditional)
- Phase 4 — Clean
SKILL.md preview
---
name: claude-cleanup
description: >-
Use when the user says "clean up claude.json", "remove stale projects", "prune
old project entries", "clean up my Claude project history", or wants to remove
project entries from ~/.claude.json whose directories no longer exist on disk.
---
# Claude Cleanup
Remove project entries from `~/.claude.json` whose directories no longer exist
on disk.
## When NOT to Use
- The user wants to delete *all* project history (this only removes entries whose directories are missing)
- The user wants to manually edit `~/.claude.json` for other reasons
## Rules
1. **Always run Phase 1 first.** Never skip straight to cleanup.
2. **Never delete entries without the user seeing the stale list.**
3. **Stop after Phase 1 if nothing is stale.** Do not ask about /insights.
## Setup: Resolve the script path
The system-reminder at load time contains: `Base directory for this skill: <path>`
Use that value to derive the plugin root:
```bash
# SKILL_BASE = the base directory shown in the system context
PLUGIN_ROOT="${SKILL_BASE%/skills/claude-cleanup}"
SCRIPT="$PLUGIN_ROOT/scripts/cleanup.sh"
```
Use `$SCRIPT` for all bash invocations below.
## Phase 1 — Scan
Run:
```bash
bash "$SCRIPT" --dry-run
```
- If output starts with "Nothing to clean", report this to the user and **stop**.
- Otherwise display the stale paths listed in the output.
## Phase 2 — Insights prompt
Ask the user with `AskUserQuestion`:
- **Question:** "Run /insights before cleaning up?"
- **Options:** Yes, No
## Phase 3 — Insights (conditional)
If the user chose **Yes**, invoke the `/insights` built-in using the `Skill`
tool with skill name `insights`. Wait for it to complete before proceeding.
## Phase 4 — Clean
Run:
```bash
bash "$SCRIPT" --clean
```
Report the output to the user: number of entries removed and backup location
(`~/.claude.json.bak`).
Versions
The database has no other skills named claude-cleanup.
Database snapshot: 13.11.2026 · package version 8364e5e92d3f (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Similar skills
- 90ce:review-cleanup
Use when the operator wants to delete old ce:review run directories under .context/systematic/ce-review/ to free disk space or purge stale local review evidence. Use when asked to clean up, prune, or remove old review runs, review artifacts, or review-summary.json history. - 100cleanup
Safely analyze and clean up Claude Code git worktrees with Bonsai. Use when the user asks to clean, prune, remove, audit, or reclaim disk space from Claude Code worktrees, stale agent worktrees, or .claude/worktrees directories. - 100memory-cleanup
Clean up stale entries - closed issues, merged MRs, expired ephemeral namespaces, old session logs. Use when user says "clean memory", "memory cleanup", or "remove stale entries". - 90clean-claude-memory
Audit, prune, rewrite, or relocate Claude Code project memory. Use when the user asks to review, clean, update, or remove Claude memory files, eliminate stale project memories, or rebuild MEMORY.md. - 100project-inventory
Discovers and inventories all Claude Code and AI-integrated projects across specified directories. Scans for CLAUDE.md files, .claude/ directories, AI SDK imports, and MCP configurations, then generates structured reports in Markdown, JSON, and a self-contained HTML portfolio… - 100session-cleanup
This skill should be used when the user wants to analyze and close stale Claude Code background sessions (the entries in `claude agents` / the agents view) so the view stops accumulating cruft. Builds a close/keep plan against a rubric based on what closing would actually lose…