Install
$ agentstack add skill-daniel-p-green-codex-cleaner-codex-cleaner ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Codex Cleaner
Audit and clean local Codex storage safely. Focus on ~/.codex session files, logs, caches, generated artifacts, and temporary files without reading chat contents during audit.
Workflow
- Start with an audit unless the user already provided recent audit output.
- Inspect storage by metadata only:
``bash python3 scripts/codex_cleaner.py audit ``
- Explain the largest storage areas in plain language and separate report-only database files from cleanup candidates.
- Propose the smallest useful cleanup command before running cleanup.
- Run cleanup first as a dry run:
``bash python3 scripts/codex_cleaner.py clean --target sessions --older-than 60 ``
- Require explicit user approval before adding
--execute.
Safety Rules
- Treat
~/.codexas the only v1 storage root unless the user passes a different root for testing. - Use audit output to identify likely wins; do not inspect, summarize, or quote chat/log contents.
- Keep sqlite, WAL, and SHM files report-only. Do not delete, vacuum, checkpoint, or mutate live databases.
- Keep cleanup dry-run by default. Add
--executeonly after the user confirms the exact command. - Prefer archiving old sessions over deleting them directly.
- Skip symlinks and surface permission errors as warnings instead of forcing access.
Script Commands
Audit
Run:
python3 scripts/codex_cleaner.py audit
Use --root for fixtures or non-default local testing. Use --top to change how many large files and top-level entries are shown.
Audit reports:
- Total storage under the root.
- Top-level file and directory sizes.
- Session usage grouped by
YYYY-MM. - Largest session
.jsonlfiles. - Log, sqlite, WAL, and SHM files as report-only items.
- Special storage areas such as sessions, generated images, cache, tmp,
.tmp, and archived sessions.
Clean
Run dry-run cleanup:
python3 scripts/codex_cleaner.py clean --target sessions --older-than 60
Run confirmed cleanup:
python3 scripts/codex_cleaner.py clean --target sessions --older-than 60 --execute
Supported targets:
sessions: archive old session files to~/.codex-cleaner/archives/before deleting originals.generated-images: delete old top-level generated image entries.tmp: delete old top-level entries undertmpand.tmp.
Use --archive-root only for fixture tests or when the user explicitly wants archives somewhere else.
Response Pattern
When reporting results, include:
- The root audited or cleaned.
- Total size and the top few storage areas.
- Cleanup candidates and estimated recoverable size.
- Whether the run was dry-run or executed.
- Any warnings or skipped paths.
Keep recommendations conservative. If the largest files are live databases or recent sessions, say they are report-only or should be kept unless the user has a specific retention policy.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: daniel-p-green
- Source: daniel-p-green/codex-cleaner
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.