Safe, configurable cleanup tooling for AI agent workspaces (Codex / Claude Code / OpenClaw).
collectmode: collect cleanup candidates only, no deletion.reviewmode: collect candidates and write a Markdown review report.deletemode: delete only approved candidates from an approval file.- Agent profile loading (
codex/claude/openclaw/ custom JSON). - API key binding support via environment variable (
--provider,--api-key-env). - Collector context policy:
- allow/deny roots
- deny patterns
- protected files
- cleaner persona + principles
cleanup: legacy structured cleanup (snapshots/specimens/trials/media dedupe).collect: candidate collection only.review: candidate collection + review markdown.delete: execute approved cleanup actions only.
cd tools\g5_scavenger
python scavenger.py --config config.example.json --mode safe --operation collectGenerate review report:
python scavenger.py --config config.example.json --mode balanced --operation reviewApply approved deletions:
python scavenger.py --config config.example.json --mode balanced --operation deleteLegacy cleanup pipeline:
python scavenger.py --config config.example.json --mode balanced --operation cleanup --dry-runDefault path: state/g5_scavenger_approve.json
{
"approve_candidate_ids": [
"dup-xxxx-xxxx",
"stale-xxxx-xxxx"
],
"approve_paths": [
"C:/path/to/file.tmp"
]
}delete mode only removes entries listed in this file.
Use built-ins:
python scavenger.py --config config.example.json --agent-profile openclaw --operation reviewUse custom profile JSON:
python scavenger.py --config config.example.json --agent-profile custom --agent-profile-file .\my_profile.json --operation collect$env:OPENAI_API_KEY = "sk-..."
python scavenger.py --config config.example.json --provider openai --api-key-env OPENAI_API_KEY --operation reviewCurrent v1.1 records provider/key-loaded status in reports for future semantic cleanup extensions.
python patrol.py --config config.example.json --mode balanced --cycles 0 --interval-seconds 1800 --auto-apply --apply-threshold-mb 256- Start with
collectorreview. - Keep
use_trash=trueto move files into trash first. - Avoid
--hard-deleteunless you have backups. - Keep critical areas in
collector_context.deny_rootsandprotected_files.