Skip to content
Skills Library
AI & agents · Automation

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.

Licence
MIT
Last repository change
22.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.

Licence

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

clean up claude.jsonremove stale projectsprune old project entriesclean up my Claude project history
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

  1. When NOT to Use
  2. Rules
  3. Setup: Resolve the script path
  4. Phase 1 — Scan
  5. Phase 2 — Insights prompt
  6. Phase 3 — Insights (conditional)
  7. Phase 4 — Clean
Original SKILL.md headings · 65 lines, 247 words
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

: harmful content, incorrect descriptions or an author’s removal request.

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…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.