This skill should be used when users want to clean up, audit, or optimize their Claude configuration folders (~/.claude or .claude)...
This skill performs comprehensive audits of Claude configuration folders to identify waste, redundancy, and optimization opportunities.
user (default) | project | alluser: Analyzes ~/.claude (global user configuration)project: Analyzes .claude in current working directoryall: Analyzes both locationsSystematically scan the target directory for all configuration artifacts:
# Find all hook files
find <target> -name "*.js" -path "*/hooks/*" -type f
find <target> -name "*.ts" -path "*/hooks/*" -type f
For each hook, analyze:
find <target> -name "*.md" -path "*/commands/*" -type f
For each command:
ls -la <target>/plugins/
Analyze:
du -sh <target>/*
find <target> -type f -size +100k
find <target> -name "*.log" -o -name "*.jsonl"
Identify:
cat <target>/settings.json
cat <target>/.mcp.json
cat <target>/CLAUDE.md
Check for:
find <target> -path "*/rules/*" -type f
find <target> -path "*/agents/*" -type f
Analyze:
For each discovered item, calculate:
Token Cost
Storage Impact
Value Assessment
Risk Rating
Compile findings into a structured action plan:
# Claude Housekeeping Report
**Scope**: [user/project/all]
**Analyzed**: [timestamp]
**Total Files Scanned**: [count]
## Executive Summary
- Total potential token savings: ~[X]k tokens/session
- Storage recoverable: [X] MB
- Items requiring attention: [count]
## Priority Actions
### ๐ด High Priority (Immediate token savings)
| Item | Current Impact | Action | Savings |
|------|---------------|--------|---------|
| [file/item] | [X] tokens/load | [action] | [benefit] |
### ๐ก Medium Priority (Optimization opportunities)
| Item | Current Impact | Action | Savings |
|------|---------------|--------|---------|
### ๐ข Low Priority (Nice to have)
| Item | Current Impact | Action | Savings |
|------|---------------|--------|---------|
## Detailed Findings
### Hooks ([count] found)
[Per-hook analysis with specific recommendations]
### Commands ([count] found)
[Per-command analysis]
### Plugins ([count] found)
[Plugin cache and configuration analysis]
### Storage ([size] total)
[Storage breakdown and cleanup opportunities]
### Configuration
[Settings optimization opportunities]
## Before/After Comparison
| Metric | Before | After | Improvement |
|--------|--------|-------|-------------|
| Context overhead | [X] tokens | [X] tokens | -[X]% |
| Disk usage | [X] MB | [X] MB | -[X]% |
| Startup time | [estimated] | [estimated] | [improvement] |
## Recommended Actions
Select which actions to perform:
1. [ ] [Action 1 - description]
2. [ ] [Action 2 - description]
...
After presenting the plan, wait for user selection:
| Pattern | Problem | Solution |
|---|---|---|
| Large JSON injection | Every tool call adds 1000+ tokens | Cache in file, load on demand |
| Verbose logging | Debug logs in production hooks | Add log level controls |
| Duplicate context | Same info in multiple hooks | Consolidate to single source |
| Synchronous file reads | Reading files that don't exist | Add existence checks |
| Pattern | Problem | Solution |
|---|---|---|
| Verbose prompts | 500+ word command definitions | Condense to essentials |
| Unused commands | Old experiments never removed | Archive or delete |
| Duplicate commands | Same function, different names | Consolidate |
| Pattern | Problem | Solution |
|---|---|---|
| Log accumulation | No rotation, grows forever | Add log rotation |
| Cache sprawl | Old plugin versions cached | Clean old versions |
| Orphaned files | Temp files, failed operations | Remove orphans |
.housekeeping-backup/ before removing/housekeeping # Analyze ~/.claude (default)
/housekeeping scope=project # Analyze .claude in current project
/housekeeping scope=all # Analyze both user and project
When presenting findings, always show the comparative benefit so users can make informed decisions about which optimizations to pursue.