codex-cleaner
Monitor and clean invalid codex auth files from CPA (Codex Provider Agent). Checks quota status, disables 401 files, double-verifies before deletion. Use when user mentions "codex clean", "clean auth", "auth files", "CPA清理", "codex 认证", "清理无效文件", or needs to manage codex authentication files.
Why use this skill?
Automate the cleaning and validation of your Codex Provider Agent authentication files with this OpenClaw skill. Features double-verification and reporting.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/geekjair/codex-cleanerWhat This Skill Does
The codex-cleaner skill is a powerful maintenance utility for the Codex Provider Agent (CPA) infrastructure. It automates the lifecycle management of authentication files by monitoring their validity and purging those that return 401 Unauthorized errors. The skill operates via a multi-stage process: it performs concurrent quota checks on active files, proactively disables those that fail authentication, and utilizes a robust double-verification mechanism before final deletion. This safety-first approach ensures that valid credentials experiencing temporary connectivity issues are not accidentally removed. Built using pure Python, it requires zero external dependencies, making it an ideal candidate for integration into secure, resource-constrained environments or autonomous agents.
Installation
To integrate this utility, run the following command in your terminal:
clawhub install openclaw/skills/skills/geekjair/codex-cleaner
Once installed, navigate to the skill workspace and perform the initial setup:
cd ~/.nanobot/workspace/skills/codex-cleaner && python3 scripts/codex_cleaner.py setup
This will generate a config.json file where you can define your CPA URL, administrative credentials, and optional notification preferences for reporting.
Use Cases
- Proactive Infrastructure Maintenance: Schedule regular cleaning cycles to prevent the accumulation of dead auth files.
- Quota Management: Use the status command to audit current authentication health across your fleet.
- Automated Recovery: Run the monitor command to continuously watch over the environment, ensuring that expired or invalid files are cleaned up in real-time without manual intervention.
- Reporting & Auditing: Generate summary reports to track the volume of cleaned files, which helps in identifying potential issues with authentication providers.
Example Prompts
- "Hey OpenClaw, please run a codex clean to remove any expired auth files from the system."
- "Can you check the current status of my auth files and perform a cleanup if there are any invalid ones?"
- "I suspect some CPA files are broken. Please execute an auth files cleanup and show me the report."
Tips & Limitations
- Verification is Key: The 2-second wait between double-verification stages is critical. Do not reduce this value unless you have a high-latency network connection.
- Security: Ensure
config.jsonremains secure, as it contains your CPA admin key. It is gitignored by default, but handle access permissions carefully on shared systems. - Reporting: Use the
--reportflag during periodic cron jobs to get actionable insights directly in your notification channels.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-geekjair-codex-cleaner": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read, external-api, code-execution