Codex CLI Task (Async) for Openclaw

An asynchronous AI agent orchestration skill that executes long-running coding, research, and automation tasks in the background with results delivered to mobile messaging apps.

sbrin
v1.1.4
Mar 19, 2026
1
500
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install codex-cli-task

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-cli-task 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 CLI Task (Async)?

The Codex CLI Task is a sophisticated background orchestration tool designed for the Openclaw Skills ecosystem. It allows developers to offload complex, multi-step tasks—such as codebase refactoring, deep research, and automated file generation—to a detached OpenAI Codex process. By running asynchronously via the shell, it ensures that the primary agent remains responsive while performing heavy lifting at zero active token cost during the execution phase.

This skill is engineered for reliability and developer-friendly visibility. It features a robust notification pipeline that delivers heartbeats, mid-task progress updates, and final results directly to Telegram threads or WhatsApp groups. It treats the AI as a general-purpose agent with full filesystem access and shell execution capabilities, making it ideal for scenarios where a simple chat interface isn't sufficient for the technical depth required.

Codex CLI Task (Async) Use Cases

  • Autonomous Research: Perform web searches, competitive analysis, and UX report synthesis.
  • Codebase Engineering: Execute large-scale refactoring, script creation, and API development.
  • Technical Analysis: Deep-dive into logs, source code, and data files to extract actionable insights.
  • Complex Automations: Manage multi-stage workflows involving filesystem access and external tool execution.
  • Long-running Tasks: Offload processes that exceed standard API timeout limits or require persistent state.

How Codex CLI Task (Async) Works

  1. Pre-launch Planning: The agent posts a short strategy in the chat, clarifying assumptions and expected outcomes.
  2. Safe Prompting: The task prompt is saved to a temporary local file to prevent shell argument parsing errors.
  3. Detached Execution: The skill launches run-task.py using nohup, detaching the process from the current OpenClaw session.
  4. Real-time Monitoring: A heartbeat system pings the delivery channel every 60 seconds, while Codex can send mid-task updates via an injected notification script.
  5. Completion & Wake: Upon finishing, the skill delivers the final result to the configured channel and triggers an agent wake-up event to summarize the findings.

Codex CLI Task (Async) Setup

Ensure you have codex and python3 installed on your system. Configuration requires setting your gateway auth tokens and session visibility in the Openclaw Skills framework.

# Standard Telegram thread-safe launch
nohup python3 run-task.py \
  --task "$(cat /tmp/prompt.txt)" \
  --project ~/my-project \
  --session "agent:main:main:thread:THREAD_ID" \
  --timeout 900 \
  > /tmp/codex-run.log 2>&1 &

Codex CLI Task (Async) Data Schema & Taxonomy

The skill manages persistent data and metadata to ensure session continuity and crash recovery:

File Path Description
~/.openclaw/codex_sessions.json Registry of all Codex thread IDs, labels, and status.
skills/codex-cli-task/pids/ Directory tracking active process IDs for lifecycle management.
/tmp/codex-orchestrator-state-<hash>.json Per-project state files to prevent duplicate wake events.
/tmp/codex-notify-{pid}.py Temporary scripts generated to allow Codex to send mid-task updates.
/tmp/codex-YYYYMMDD-HHMMSS.txt Captured final output of the Codex execution.

Codex CLI Task (Async) Advanced Features

  • Session Resumption: Continue previous AI conversations by passing the specific Codex thread_id via the --resume flag.
  • Thread-Safe Routing: Strict Telegram routing ensures notifications always land in the correct forum topic or DM thread.
  • Iterative Continuation: Support for iterate mode where the agent automatically evaluates gaps and launches follow-up phases.
  • E2E Validation: Built-in --validate-only mode to verify routing and session metadata before committing to a long-running run.
  • Fail-Fast Logic: Automatic detection of invalid routing or unresolved session UUIDs to prevent silent misroutes.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*