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.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "codex-cleaner" with this command: npx skills add geekjair/codex-cleaner

Codex Auth File Cleaner

Clean invalid codex auth files via CPA management API. Zero dependencies (pure Python stdlib).

First Run

Run setup wizard to configure CPA URL and admin key:

python3 scripts/codex_cleaner.py setup

Config saved to config.json (auto-created, gitignored). Config priority: CLI args > env vars (CPA_URL/CPA_KEY) > config.json.

Commands

# View status
python3 scripts/codex_cleaner.py status
python3 scripts/codex_cleaner.py status --json

# Check active files, disable 401s
python3 scripts/codex_cleaner.py check

# Double-verify disabled files, then delete confirmed 401s
python3 scripts/codex_cleaner.py delete

# Full clean (check + delete), output human-readable report
python3 scripts/codex_cleaner.py clean --report

# Full clean, output JSON
python3 scripts/codex_cleaner.py clean --json

# Loop mode (default 300s interval)
python3 scripts/codex_cleaner.py monitor -i 300

Workflow

clean = check + delete

check:  fetch active codex files → concurrent quota check → disable 401s
delete: fetch disabled files → verify#1 (401?) → wait 2s → verify#2 (still 401?) → delete

Double verification prevents accidental deletion of temporarily failing files.

Nanobot Integration

For periodic monitoring, run clean --report via HEARTBEAT or cron, then send the stdout report to the user via message tool.

Example:

cd ~/.nanobot/workspace/skills/codex-cleaner && python3 scripts/codex_cleaner.py clean --report

Report Format

🧹 Codex 认证清理报告
⏰ 2026-02-26 13:50:00

📊 清理前
  总计: 100 | 可用: 85 | 已禁用: 15

🔍 检查阶段
  检测: 85 | 失效(401): 3 | 已禁用: 3

🗑️ 删除阶段
  待删: 18 | 验证通过: 15 | 已删除: 15 | 跳过: 3

📊 清理后
  总计: 85 | ✅可用: 82 | ⛔已禁用: 3

⚡ 本次清理: 禁用 3 + 删除 15 = 18 个无效文件

Config File

config.json (auto-generated by setup wizard):

{
  "cpa_url": "http://YOUR_CPA_HOST:PORT",
  "cpa_key": "YOUR_ADMIN_KEY",
  "concurrency": 20,
  "monitor_interval": 300,
  "notify": {
    "enabled": true,
    "channel": "telegram",
    "chat_id": "YOUR_CHAT_ID"
  }
}

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

redmine-tools

Fetch, update, and summarize Redmine issue attachments from CLI.

Registry SourceRecently Updated
Coding

进出口许可文档智能预审系统

进出口许可文档智能预审系统。支持 PDF 和图片处理:自动提取合同号、出口国、进口商、总金额、数量、重量、合格证编号、生产商、报关口岸等字段,检测公章,按审核规则执行审核,生成 MD 和 JSON 审核报告。支持 CLI 和对话交互两种方式触发。

Registry SourceRecently Updated
Coding

Coding Rules

当用户要求生成、修改或审查 Vue3 + TypeScript 子项目代码时触发。 覆盖 kb-pro-table / useTable / useForm 使用规范、arco design + unocss 样式规则、 模块组织与命名规范、枚举与类型约束、ref 优先的响应式规范等。 无论用户是否明确提到"规范...

Registry SourceRecently Updated
Coding

gspread-sheets

Batch read/write Google Sheets using the gspread Python library with service account authentication. Use when the user needs to: (1) read/write/update/clear...

Registry SourceRecently Updated