smithery.ai

claude-hygiene

Manage ~/.claude/ data - report, archive, extract learnings, clean up

First seen Apr 18, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

Allowed toolsBash, Read, Write, Glob, Grep
Declared agents claude-code

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,184 B
  • docs SUMMARY.md 91 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Claude Hygiene Skill

Manage and maintain ~/.claude/ data: audit sizes, archive old sessions, extract learnings, and clean up low-value files.

Usage

/claude-hygiene                    # Show help
/claude-hygiene report             # Audit current state
/claude-hygiene archive            # Archive old sessions (dry-run)
/claude-hygiene extract            # Find high-value sessions
/claude-hygiene clean              # Show cleanup targets

Commands

Run all commands via Bun from the skill directory:

SKILL_DIR=~/dev/whoabuddy/claude-knowledge/claude-config/skills/claude-hygiene

Report

Audit all .claude data with size breakdown, session age distribution, and reclaimable space estimates.

bun run $SKILL_DIR/src/hygiene.ts report
bun run $SKILL_DIR/src/hygiene.ts report --json
bun run $SKILL_DIR/src/hygiene.ts report --threshold 14

Archive

Compress old session JSONL files with gzip and move to ~/logs/archive/claude/sessions/{YYYY-MM}/.

bun run $SKILL_DIR/src/hygiene.ts archive                    # Dry run (default)
bun run $SKILL_DIR/src/hygiene.ts archive --no-dry-run       # Actually archive
bun run $SKILL_DIR/src/hygiene.ts archive --threshold 14     # Archive sessions >14 days old
bun run $SKILL_DIR/src/hygiene.ts archive --no-dry-run --delete-originals  # Archive + delete

Extract

Score sessions by heuristics and generate a review file for manual knowledge curation.

bun run $SKILL_DIR/src/hygiene.ts extract                    # Last 90 days, score >= 3
bun run $SKILL_DIR/src/hygiene.ts extract --days 30          # Last 30 days only
bun run $SKILL_DIR/src/hygiene.ts extract --project ~/dev/aibtcdev/x402-api
bun run $SKILL_DIR/src/hygiene.ts extract --threshold 5      # Only high-value sessions

Output goes to ~/logs/archive/claude/extractions/.

Clean

Delete low-value files. Always preview first with dry-run (default).

bun run $SKILL_DIR/src/hygiene.ts clean                      # Show all targets
bun run $SKILL_DIR/src/hygiene.ts clean --todos              # Dry-run empty todos
bun run $SKILL_DIR/src/hygiene.ts clean --todos --no-dry-run # Actually delete
bun run $SKILL_DIR/src/hygiene.ts clean --debug --no-dry-run # Delete debug logs
bun run $SKILL_DIR/src/hygiene.ts clean --delete-archived --confirm --no-dry-run  # Delete archived originals

Workflow

When the user invokes /claude-hygiene, determine the intent:

  1. No args or "report" - Run the report command and display results
  2. Specific command - Run that command with the given flags
  3. "weekly" - Run report, then suggest archive + extract based on results
  4. "monthly" - Run report, archive --no-dry-run, extract, then suggest clean targets

Always show dry-run results first before performing destructive operations.

State

Processing state is tracked at ~/.claude/.hygiene/state.json to avoid re-processing sessions. Archive manifest is at ~/logs/archive/claude/manifest.jsonl.