---
Cleans old archives, logs, cache, and temporary files to free up disk space.
/plugin marketplace add varaku1012/aditi.code/plugin install steering-context-generator@aditi-code-pluginsRemove old archives and temporary files to free up disk space.
/steering-clean
This will:
| Item | Location | Retention | Impact |
|---|---|---|---|
| Old archives | .claude/memory/archives/ | 7 days | Can regenerate |
| Old logs | .claude/logs/ | 30 days | Lost history |
| Cache files | .claude/steering/v2.0/cache/ | All | Rebuilt on next use |
| Temp files | .claude/memory/**/*.tmp | All | Safe to delete |
bash scripts/cleanup.sh
๐งน Cleaning Steering Context Generator artifacts...
Artifacts to clean:
Archives: 450 MB
Logs: 23 MB
Cache: 12 MB
Continue? (y/N) y
Archiving current context to .claude/memory/archives/backup_20251102_120000...
โ Archived 9 files
Cleaning old archives (>7 days)...
โ Removed 3 old archives (380 MB freed)
Cleaning old logs (>30 days)...
โ Removed 145 log files (18 MB freed)
Cleaning cache...
โ Cleared cache (12 MB freed)
Cleaning temporary files...
โ Removed 23 temp files (2 MB freed)
Cleanup complete!
Current usage:
Archives: 70 MB
Logs: 5 MB
Total: 250 MB
Total freed: 412 MB
Automatic Backup: Before cleaning, current context is archived:
.claude/memory/archives/backup_YYYYMMDD_HHMMSS/
โโโ ARCHITECTURE.md
โโโ AI_CONTEXT.md
โโโ CODEBASE_GUIDE.md
โโโ ...
Confirmation Prompt: Interactive mode asks for confirmation before deleting.
Dry Run: See what would be cleaned without actually deleting:
bash scripts/cleanup.sh --dry-run
Remove all archives (not recommended):
# Manual aggressive cleanup
rm -rf .claude/memory/archives/*
rm -rf .claude/logs/*
Clean specific areas only:
Archives only:
find .claude/memory/archives -type d -mtime +7 -exec rm -rf {} +
Logs only:
find .claude/logs -type f -mtime +30 -delete
Cache only:
rm -rf .claude/steering/v2.0/cache/*
Edit scripts/cleanup.sh to change retention periods:
# Archives: Change from 7 to 30 days
find .claude/memory/archives -type d -mtime +30 -exec rm -rf {} +
# Logs: Change from 30 to 90 days
find .claude/logs -type f -mtime +90 -delete
Regular Maintenance:
Signs You Need Cleaning:
Recent Backup:
# List available backups
ls -lh .claude/memory/archives/backup_*/
# Restore latest backup
LATEST=$(ls -t .claude/memory/archives/backup_* | head -1)
cp -r $LATEST/*.md .claude/steering/
From Git: If context files are committed:
git log -- .claude/steering/
git checkout HEAD~1 -- .claude/steering/
Regenerate: If no backups available:
/steering-generate
chmod +x scripts/cleanup.sh
Check hidden or locked files:
lsof | grep .claude
# Restore from latest backup
LATEST=$(ls -t .claude/memory/archives/backup_* | head -1)
cp -r $LATEST/*.md .claude/steering/
Free up space: Run /steering-clean regularly!