Clean up temporary files and archive useful markdown.
Delete temporary files and archive useful markdown to keep your project clean after tasks. Preview changes before executing, with options to focus on specific patterns or folders.
/plugin marketplace add unclecode/claude-code-tools/plugin install unclecode-cc-toolkit@unclecode-toolsClean up temporary files and archive useful markdown.
$ARGUMENTS
After tasks/updates, clean up the project:
Look in project root and common locations for:
Temporary files (to DELETE):
*_test.md, test_*.mdscratch*.md, temp*.md, tmp*.mddebug*.md, *_debug.md*.log (unless in logs/ folder)output*.md, *_output.mdDELETE or TEMP in namePotentially useful markdown (to ARCHIVE):
draft_*.md, *_draft.mdnotes_*.md, *_notes.mdresearch_*.mdold_*.md, *_old.md, *_backup.mdv1_*.md, *_v1.md (old versions).md file in root that's not part of standard structureIf query provided, focus on:
/pp-clean test files/pp-clean webhook//pp-clean archive only or /pp-clean delete only## Cleanup Preview
### To DELETE (temporary files)
- scratch_booking.md
- test_output.md
- debug_log.md
### To ARCHIVE (move to .context/project/archive/)
- draft_system_prompt.md
- research_notes.md
- old_booking_flow.md
### No Action
- (files that look fine)
---
Proceed with cleanup? (yes/no/edit)
If user says "edit", allow them to:
Delete temporary files:
rm {temp_files}
Archive useful markdown:
# Create dated archive subfolder if multiple files
mkdir -p .context/project/archive/cleanup_{date}
mv {markdown_files} .context/project/archive/cleanup_{date}/
Or if single file:
mv {file} .context/project/archive/{file}
Add entry to appropriate CHANGELOG:
## {DATE} | Cleanup
**Deleted**:
- scratch_booking.md
- test_output.md
**Archived**:
- draft_system_prompt.md → archive/cleanup_{date}/
- research_notes.md → archive/cleanup_{date}/
**Context**:
- Post-task cleanup
- {query context if provided}
## Cleanup Complete
**Deleted**: 3 temporary files
**Archived**: 2 markdown files → archive/cleanup_{date}/
Project directory is clean.
This cleanup logic should also run:
/pp-update completesWhen auto-triggered, still show preview and get confirmation.
# General cleanup
/pp-clean
# Focus on specific pattern
/pp-clean test files
# Focus on specific folder
/pp-clean webhook/
# Archive only (no deletions)
/pp-clean archive only
# Delete only (no archiving)
/pp-clean delete only
# With context
/pp-clean after completing booking flow
.context/project/ structure filesprds/, docs/ folders.env, config files*_test.md, test_*.md
scratch*.md, temp*.md, tmp*.md
debug*.md, *_debug.md
output*.md, *_output.md
*.log (loose logs)
*DELETE*, *TEMP*
draft_*.md, *_draft.md
notes_*.md, *_notes.md
research_*.md
old_*.md, *_old.md, *_backup.md
v[0-9]_*.md, *_v[0-9].md
Loose .md files not in structure
.context/project/**/*.md (structure files)
prds/*.md, docs/*.md
README.md, CLAUDE.md
.env, *.json, *.py, *.js, etc.