Codex CLI Task (Async) for Openclaw

An asynchronous orchestration skill for OpenAI Codex that executes complex background tasks and delivers results directly to your preferred messaging channel.

sbrin
v1.0.0
Mar 9, 2026
1
499
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install codex-code-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-code-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 powerful Openclaw Skills integration designed to transform OpenAI Codex into a fully autonomous, asynchronous background agent. Unlike standard interactive assistants, this skill allows for long-running workflows—such as deep codebase research, refactoring, and multi-step file generation—without consuming live session tokens or requiring real-time monitoring.

By leveraging detached execution through nohup, the skill ensures that complex operations continue until completion, at which point results are delivered via secure thread-safe routing to Telegram or WhatsApp. It acts as a general-purpose AI agent with full filesystem access and shell execution capabilities, making it ideal for developers who need to delegate intensive tasks while staying within the same conversation context.

Codex CLI Task (Async) Use Cases

  • Researching large codebases and generating competitive analysis reports.
  • Refactoring legacy code modules or implementing new API endpoints asynchronously.
  • Running automated E2E validation flows and technical smoke tests.
  • Generating comprehensive documentation and project summaries from local data.
  • Executing complex multi-step workflows that require filesystem and shell access.

How Codex CLI Task (Async) Works

  1. The user provides a task prompt which is saved to a temporary file to avoid shell quoting issues.
  2. OpenClaw resolves the session key and validates routing metadata for the target channel.
  3. The task is launched as a detached process using nohup, allowing the agent to stop the current turn immediately.
  4. A heartbeat mechanism pings the notification channel every 60 seconds to signal the task is still active.
  5. Upon completion or error, the script captures the output and delivers it to the source Telegram thread or WhatsApp group.
  6. The agent is woken via a continuation turn to analyze the results and determine if further iterations are needed.

Codex CLI Task (Async) Setup

Ensure you have the required dependencies and configuration in place for Openclaw Skills:

# Ensure python3 and codex bins are available
# Install required python modules
pip install requests

# Configure OpenClaw gateway access
openclaw config set gateway.auth.token "your_token"

To launch a task, use the following pattern:

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 maintains state and logs using a structured approach to ensure reliability and traceability within Openclaw Skills.

File/Directory Purpose
~/.openclaw/ Main configuration and state directory.
/tmp/codex-orchestrator-state-*.json Per-project execution state and deduplication guards.
~/.openclaw/codex_sessions.json Registry for session IDs and metadata for resumption.
skills/codex-cli-task/pids/ PID tracking for active background processes.
/tmp/codex-run.log Execution logs for stdout and stderr.

Codex CLI Task (Async) Advanced Features

  • Thread-Safe Routing: Strict enforcement of Telegram DM thread IDs to prevent misrouted messages.
  • Session Resumption: Ability to continue previous conversations using captured Codex session IDs.
  • Iterative Mode: Automated follow-up logic where the agent evaluates results and launches new iterations.
  • Mid-Task Updates: Injected Python scripts that allow Codex to send progress markers during execution.
  • Silent Notifications: Support for silent Telegram alerts to minimize user interruption during background work.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*