name: oac-cleanup description: Clean up old temporary files from .tmp directory argument-hint: "[--force] [--days=N]"
Remove old temporary files from the .tmp directory to free up disk space.
The cleanup script checks three directories:
.tmp/sessions/ - Session context files older than 7 days.tmp/tasks/ - Completed task files older than 30 days.tmp/external-context/ - Cached external documentation older than 7 days!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/cleanup-tmp.sh`
This will:
!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/cleanup-tmp.sh --force`
⚠️ Warning: This deletes files immediately without confirmation.
# Clean sessions older than 14 days
!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/cleanup-tmp.sh --session-days=14`
# Clean tasks older than 60 days
!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/cleanup-tmp.sh --task-days=60`
# Clean external context older than 3 days
!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/cleanup-tmp.sh --external-days=3`
# Combine options
!`bash ${CLAUDE_PLUGIN_ROOT}/scripts/cleanup-tmp.sh --session-days=14 --task-days=60 --force`
The script is smart about what it deletes:
You can customize default cleanup thresholds in your .oac config file:
cleanup:
auto_prompt: true # Prompt for cleanup on session start
session_days: 7 # Days before suggesting session cleanup
task_days: 30 # Days before suggesting task cleanup
external_days: 7 # Days before suggesting external context cleanup
See /oac:setup for more about configuration.
The script outputs JSON with cleanup results:
{
"status": "success",
"deleted": {
"sessions": 3,
"tasks": 5,
"external": 2
},
"freed_space": "2.4 MB",
"summary": "Cleaned up 10 old temporary files, freed 2.4 MB"
}
Run cleanup when:
.tmp directory is getting large"No old files found"
"Permission denied"
"Cannot delete active session"
/oac:status - Check current .tmp directory status/oac:setup - Configure cleanup settings/oac:help - General helpTip: Run cleanup regularly to keep your workspace clean and avoid accumulating old temporary files.