Codex Auth File Cleaner for Openclaw

An automated utility for monitoring, disabling, and purging invalid Codex authentication files from the Codex Provider Agent (CPA).

geekjair
v1.0.3
Feb 26, 2026
0
1.3k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install codex-cleaner

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install codex-cleaner using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Codex Auth File Cleaner?

The Codex Auth File Cleaner is a specialized management tool designed to maintain the integrity of authentication files within the Codex Provider Agent (CPA) ecosystem. By providing a zero-dependency Python solution, it allows developers to automate the tedious process of identifying expired or unauthorized credentials that can lead to 401 errors. This skill is an essential component for users of Openclaw Skills who require high availability and reliability from their AI coding agents.

Built for efficiency, the skill handles high-concurrency health checks and implements a multi-stage verification process to ensure no valid file is ever deleted by mistake. Whether used as a standalone CLI tool or integrated into a larger automation suite, it ensures your provider backend remains lean and functional.

Codex Auth File Cleaner Use Cases

  • Automatically disabling Codex provider files that return 401 unauthorized errors.
  • Purging confirmed invalid auth files through a safe double-verification workflow.
  • Running periodic background monitoring to keep the CPA instance clean and efficient.
  • Generating detailed cleaning reports for integration with Openclaw Skills dashboards or telegram notifications.
  • Managing large batches of credentials using high-concurrency quota checks.

How Codex Auth File Cleaner Works

  1. The skill initiates a check by fetching all active codex files via the CPA management API.
  2. It performs concurrent quota and status checks across the retrieved files to identify those failing with 401 status codes.
  3. Any identified unauthorized files are moved to a disabled state to prevent them from being served to clients.
  4. During the deletion phase, the skill fetches disabled files and subjects them to two separate verification checks with a 2-second delay in between.
  5. Only files that consistently fail both verification steps are permanently deleted from the system.
  6. A comprehensive summary report is generated, detailing the counts for total, disabled, and deleted files.

Codex Auth File Cleaner Setup

To get started with this skill in your environment, follow these installation and configuration steps:

# Navigate to the skill directory
cd ~/.nanobot/workspace/skills/codex-cleaner

# Run the interactive setup wizard
python3 scripts/codex_cleaner.py setup

The wizard will ask for your CPA URL and Admin Key. This information is saved to a config.json file which is automatically used by subsequent commands. You can also override these settings using environment variables like CPA_URL and CPA_KEY.

Codex Auth File Cleaner Data Schema & Taxonomy

The skill manages its operation through a local configuration file and structured console output. Below is the schema for the configuration and the data it tracks:

Configuration Key Type Description
cpa_url String The endpoint of your Codex Provider Agent.
cpa_key String The administrative key for CPA API access.
concurrency Integer The number of simultaneous network requests (default 20).
monitor_interval Integer Seconds between checks in loop mode (default 300).
notify Object Nested configuration for Telegram notification channels.

When running with the --json flag, the skill returns a machine-readable object containing counts for pre-clean, check, delete, and post-clean phases, facilitating integration with other Openclaw Skills components.

Codex Auth File Cleaner Advanced Features

  • Double-Verification Safety: Implements a two-step check with a time buffer to prevent accidental deletion during temporary network fluctuations.
  • Heartbeat Integration: Designed to run via HEARTBEAT or cron jobs to provide regular maintenance without manual intervention.
  • Multi-Channel Notifications: Built-in support for sending cleaning reports directly to Telegram chat IDs.
  • Loop Mode: A persistent monitor mode (-i flag) that allows the script to run as a background daemon.
  • Human-Readable Reports: Generates visual, emoji-enhanced status summaries for quick administrative review.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*