Skip to content
Back to skills

Cleanup

ASecurity

Clean .claude directory data

  • 6 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 18, 2026
ai-agentsshell

Works with

  • claude code
  • cli

Security analysis

A100/100

Scanned November 18, 2026

npx -y skills add AxGord/claude-workflow --skill cleanup --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cleanup?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cleanup
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/axgord-cleanup/badge)](https://www.skillsdirectory.com/skills/axgord-cleanup)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cleanup
description: Clean .claude directory data
---

## .claude directory cleanup

Run steps in order. **Ask user confirmation before each step.**

### Step 1: Temp data (always safe)

Delete contents of (keep directories themselves):
- `~/.claude/debug/` — session debug logs
- `~/.claude/shell-snapshots/` — zsh state snapshots
- `~/.claude/todos/` — task lists from past sessions
- `~/.claude/plans/` — plan files from past sessions

Show size before/after.

### Step 2: Project session logs

For each project in `~/.claude/projects/`:
- **DELETE**: `*.jsonl` files (conversation logs), `UUID/` directories (session caches), `agent-*.jsonl` (subagent logs)
- **KEEP**: `memory/` directory, `CLAUDE.md` file

⚠️ This breaks `/resume` for old sessions. Warn user.

Show size before/after.

### Step 3: Empty project directories

After step 2, list projects that have no remaining files (no memory/, no CLAUDE.md).
Offer to remove them — they recreate automatically when Claude Code runs in that project.

### Step 4: Memory audit

For each remaining `memory/MEMORY.md`:
1. Read its contents
2. Check each entry against existing skills — is it already covered?
3. Check if Claude already knows this without any skill
4. Present table to user:

| Entry | Duplicates? | Verdict |
|---|---|---|
| ... | skill X / common knowledge / project-specific | delete / keep |

Only modify after user approval.

### Other cleanable files

Also check and report sizes of:
- `~/.claude/history.jsonl` — conversation history (can be large)
- `~/.claude/file-history/` — file change history
- `~/.claude/paste-cache/` — clipboard cache
- `~/.claude/tasks/` — task data

These are less critical. Mention sizes, let user decide.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.