Install the "codex-cli-task" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/codex-cli-task into .claude/skills/codex-cli-task/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "codex-cli-task", then confirm the skill loads.
Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Type this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
skills CLI
$ npx skills add LeoYeAI/openclaw-master-skills --skill codex-cli-task -a codex
Project install goes to .agents/skills/; add -g for ~/.codex/skills/.
Install the "codex-cli-task" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/codex-cli-task into .agents/skills/codex-cli-task/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "codex-cli-task", then confirm the skill loads.
Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add LeoYeAI/openclaw-master-skills --skill codex-cli-task -a cursor
Project install goes to .agents/skills/; add -g for ~/.cursor/skills/.
Install the "codex-cli-task" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/codex-cli-task into .cursor/skills/codex-cli-task/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "codex-cli-task", then confirm the skill loads.
Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
skills CLI
$ npx skills add LeoYeAI/openclaw-master-skills --skill codex-cli-task -a gemini-cli
Project install goes to .agents/skills/; add -g for ~/.gemini/skills/.
Install the "codex-cli-task" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/codex-cli-task into .gemini/skills/codex-cli-task/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "codex-cli-task", then confirm the skill loads.
Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Installs for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
skills CLI
$ npx skills add LeoYeAI/openclaw-master-skills --skill codex-cli-task -a github-copilot
Project install goes to .agents/skills/; add -g for ~/.copilot/skills/.
Install the "codex-cli-task" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/codex-cli-task into .github/skills/codex-cli-task/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "codex-cli-task", then confirm the skill loads.
GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add LeoYeAI/openclaw-master-skills --skill codex-cli-task -a opencode
OpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
Install the "codex-cli-task" agent skill from https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/codex-cli-task into .opencode/skills/codex-cli-task/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "codex-cli-task", then confirm the skill loads.
OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Facts
Skill name
codex-cli-task
GitHub stars
2.2k
Token cost
~7.1k tokens
SKILL.md length
2,627 words
Files
9 (incl. scripts, references)
Skills in repo
972
Repo updated
First seen
Licence
MIT
At a glance
Launch OpenAI Codex CLI async in background with automatic delivery to Telegram/WhatsApp.
Works in 4 steps: Run routing validation first… → Launch smoke/E2E scenario via nohup and… → Wait for completion through normal async… → …
Codebase research
SKILL.md covers Important: Codex = General AI…, Quick Start, What "run tests" means for… and Async Boundary Rule (mandatory), plus 7 more sections
Runs Python and Shell scripts from its folder; calls python3 and codex; needs SESSION_KEY
What it does
Codex CLI Task is an agent skill from LeoYeAI/openclaw-master-skills. Launch OpenAI Codex CLI async in background with automatic delivery to Telegram/WhatsApp. Use for coding, refactoring, codebase research, file generation, and complex multi-step automations. NOT for quick one-off questions or real-time interactive tasks. Includes strict thread-safe routing + E2E operator validation workflow.
Its SKILL.md is about 7.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files, including scripts and reference files (for example `README.md`, `_meta.json` and `examples/README.md`).
It sits in Testing & QA, covering End-to-end testing and Refactoring. It works with Telegram and WhatsApp. The repository describes itself as: 🧠 Curated collection of 1209+ best OpenClaw skills — weekly updated by MyClaw.ai. The licence is MIT.
When your agent uses it
Codebase research
File generation
Complex multi-step automations
Example prompts
“/codex-cli-task”
Requirements
Python 3
A Bash shell
Workflow steps
4 steps, taken from the first numbered list in SKILL.md.
1Run routing validation first (--validate-only).
2Launch smoke/E2E scenario via nohup and file-based prompt.
3Wait for completion through normal async flow, not same-turn blocking.
Read from SKILL.md and the folder at commit e5199b5. It shows what the files ask for, not the result of running them.
Tool permissions
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Runs code
Ships 1 file in scripts/ (Python and Shell), which the agent can run.
Shell commands in SKILL.md call:
python3
codex
From the folder's file list and the shell code blocks in SKILL.md.
Network
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Credentials
Names these keys or tokens, usually read from environment variables:
SESSION_KEY
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Context cost
Codex CLI Task loads about 7.1k tokens when it runs, and up to ~7.9k if it reads all its reference files. Until then it costs about 85 tokens; SKILL.md has 2,627 words of instructions outside code blocks.
Always· name and description, kept in context so the agent knows when to use it
~85
When it runs· the whole SKILL.md, loaded when a task matches
~7.1k
With references· SKILL.md plus every file in references/, read only if the agent opens them
~7.9k
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
Safety
Auto-check passed
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
Download SKILL.mdSave it as .claude/skills/codex-cli-task/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
name
codex-cli-task
description
Launch OpenAI Codex CLI async in background with automatic delivery to Telegram/WhatsApp. Use for coding, refactoring, codebase research, file generation, and complex multi-step automations. NOT for quick one-off questions or real-time interactive tasks. Includes strict thread-safe routing + E2E operator validation workflow.
Codex Code Task (Async)
Run OpenAI Codex CLI in background — zero OpenClaw tokens while it works. Results delivered to WhatsApp or Telegram automatically.
Important: Codex = General AI Agent
Codex is NOT just a coding tool. In codex exec mode it is a general-purpose AI agent with file access, shell execution, optional web search, and deep reasoning.
Use it for:
Research — web search, synthesis, competitive analysis, user experience reports
After a successful nohup launch, the correct behavior is:
Send a short launch acknowledgment (PID/log/session)
Stop this turn immediately
Continue only when wake/completion event arrives in the same session
Do not keep waiting in the same turn for Codex completion.
Do not poll and then summarize in the same turn unless user explicitly asked for active live monitoring.
Anti-pattern:
❌ Launch run-task.py and keep responding as if completion should appear in this turn
Correct pattern:
✅ Launch run-task.py → acknowledge launch → stop → wait for wake
Launch Confirmation Gate (mandatory)
Never claim "launched" until you have positive launch proof.
Required proof checklist:
nohup command returned a PID
process is alive (ps -p <PID>)
run log contains 🔧 Starting OpenAI Codex... or equivalent startup marker
routing was validated (--validate-only) for Telegram thread runs
If launch fails with ❌ Invalid routing:
resolve via sessions_list
rerun with explicit routing/session arguments if needed
re-check proof checklist
only then send launch acknowledgment
Pre-launch planning note (mandatory)
Before launching Codex, post a short plan in chat:
how you plan to solve the task
what result you expect from this run
any clarifying assumptions
whether you expect one iteration or staged follow-up
If staged: explicitly say this run is "phase 1" and what signal decides phase 2.
Telegram Thread Safety (must-follow)
For Telegram thread runs, run-task.py is designed to either route correctly or fail immediately.
Mandatory step before launch
Resolve the current runtime session key first, then launch with it.
Get current key via sessions_list or runtime context
If key is agent:main:main:<thread|topic>:<THREAD_ID> → use it directly in --session
Never derive --session from chat_id / sender heuristics
Rules
Use only --session "agent:main:main:<thread|topic>:<THREAD_ID>" for thread tasks
Never use agent:main:telegram:user:<id> for thread tasks
If routing metadata is inconsistent, script exits with ❌ Invalid routing
Default mode is --telegram-routing-mode auto
Force strict thread-only behavior with --telegram-routing-mode thread-only
Force non-thread behavior with --telegram-routing-mode allow-non-thread or --allow-main-telegram
This is intentional: abort fast > silent misroute
⚠️ ALWAYS launch via nohup — exec timeout will kill the process otherwise.
⚠️ NEVER put the task text directly in the shell command — save the prompt to a file first, then use $(cat file).
WhatsApp
bash
# Step 1: Save prompt to a temp file
write /tmp/codex-prompt.txt with your task text
# Step 2: Launch with $(cat ...)
nohup python3 {baseDir}/run-task.py \
--task "$(cat /tmp/codex-prompt.txt)" \
--project ~/projects/my-project \
--session "agent:main:whatsapp:group:<JID>" \
--timeout 900 \
> /tmp/codex-run.log 2>&1 &
Do NOT use agent:main:telegram:user:<id> for thread tests/runs.
Telegram Threaded Mode (1:1 DM with threads)
When OpenClaw is used in Telegram threaded mode, each thread has its own session key like agent:main:main:thread:369520 or agent:main:main:topic:369520.
Fail-safe routing (NEW):run-task.py now enforces strict thread routing.
If --session contains :thread:<id> or :topic:<id>, the script refuses to start unless Telegram target + thread session UUID are resolved.
It auto-resolves missing values from sessions_list when possible.
If the session is inactive and not returned by API, it falls back to local session files: ~/.openclaw/agents/main/sessions/*-topic-<thread_id>.jsonl.
If provided --notify-session-id mismatches the session key, it exits with error.
Result: misrouted launches/heartbeats to main chat are blocked before Codex starts.
Use --notify-session-id to wake the exact thread session:
All 5 notification types route to the DM thread when --session key contains :thread:<id> or :topic:<id> ✅
--notify-session-id — optional override. Usually auto-resolved from session metadata/files.
--notify-thread-id — optional override. Usually auto-extracted from --session.
--reply-to-message-id — optional debug field; avoid for DM thread routing.
--validate-only — resolve routing and exit (no Codex run). Use this to verify thread launch args safely.
--notify-channel — optional channel hint (telegram/whatsapp); target is always auto-resolved from session metadata.
--timeout — max runtime in seconds (default: 7200 = 2 hours)
--completion-mode — optional legacy hint (single default, iterate if explicitly needed)
--max-iterations — optional budget hint when using iterate mode
--trace-live — emit live technical trace markers into the same chat/thread (debug mode)
Always redirect stdout/stderr to a log file
Why file-based prompts?
Research/complex prompts contain single quotes, double quotes, markdown, backticks — any of these break shell argument parsing. Saving to a file and reading with $(cat ...) avoids all quoting issues.
Channel Detection
The detect_channel() function determines where to send notifications:
Deterministic auto-resolve — target is resolved from session metadata/session key (no manual target flag)
WhatsApp auto-detect — if the session key contains @g.us (WhatsApp group JID), WhatsApp is used
Fail fast on unresolved Telegram target — script exits with ❌ Invalid routing instead of silent misroute
python
def detect_channel(session_key):
if NOTIFY_CHANNEL_OVERRIDE and NOTIFY_TARGET_OVERRIDE:
return NOTIFY_CHANNEL_OVERRIDE, NOTIFY_TARGET_OVERRIDE
jid = extract_group_jid(session_key)
if jid:
return "whatsapp", jid
return None, None
✅/❌/⏰/💥 Result notification → thread ✅ (HTML; <blockquote expandable> for result; via send_telegram_direct)
🤖 Agent continuation reply → delivered to chat via openclaw agent --deliver ✅ (same session continuation is visible to user)
send_telegram_direct() is the core mechanism for all thread-targeted notifications from external scripts. It calls api.telegram.org directly with message_thread_id — bypasses the OpenClaw message tool entirely (which cannot route to DM threads from outside a session context).
Fallback — if agent wake fails (session locked/busy): already_sent=True is set after the direct send, so no duplicate is sent.
Key detail: Telegram vs WhatsApp delivery
WhatsApp: Raw result sent directly (human sees it immediately) + sessions_send wakes agent for analysis.
Telegram: Result sent via send_telegram_direct → then agent is woken via openclaw agent --session-id --deliver so the continuation turn is visible in chat by default. This is the intended “same agent, same conversation” behavior after Codex completion.
Why not sessions_send for Telegram?sessions_send is blocked in the HTTP /tools/invoke deny list by architectural design. The openclaw agent CLI bypasses this limitation.
Telegram DM Threads vs Forum Groups
Telegram has two distinct thread models. The key difference for run-task.py is how to route messages to the thread.
The core problem with external scripts:
The OpenClaw message tool's threadId parameter is Discord-specific — ignored for Telegram
Target format "chatId:topic:threadId" is rejected by the message tool's target resolver
Session auto-routing works only inside active sessions — external scripts have no session context
Solution:send_telegram_direct() bypasses the message tool entirely; calls api.telegram.org directly with message_thread_id
DM Threaded Mode (bot-user private chat with threads):
All notifications use send_telegram_direct(chat_id, text, thread_id=..., parse_mode=...) ✅
thread_id auto-extracted from session key *:thread:<id> or *:topic:<id> by extract_thread_id()
Launch + finish: parse_mode="HTML" with <blockquote expandable> for prompt/result
parse_mode="Markdown" trap: finish messages contain **text** (CommonMark bold); Telegram MarkdownV1 rejects this with HTTP 400 — messages silently don't arrive
replyTo trap: combining replyTo + message_thread_id can cause Telegram to reject the request or route incorrectly
Agent continuation reply: openclaw agent --session-id <uuid> --deliver publishes the wake turn to chat so the user sees the same ongoing assistant conversation
Forum Groups (supergroup with Forum topics enabled):
Same send_telegram_direct() approach works; message_thread_id is standard Bot API for Forum topics
Auto-detected from session key pattern *:thread:<id> or *:topic:<id>
Codex mid-task updates:
Do NOT embed bot tokens or curl commands in the task prompt
run-task.py writes /tmp/codex-notify-{pid}.py to disk before launching Codex
session registry entry in ~/.openclaw/codex_sessions.json
Long-running task guidance
If a Codex task is expected to run longer than ~1 minute, explicitly ask Codex to send intermediate progress updates during execution.
Recommended wording:
"Send a progress update when you start"
"Send another update after major milestone(s)"
"If task exceeds 60 seconds, send at least one heartbeat-style update"
For Telegram thread-safe runs, updates should use the injected automation script (/tmp/codex-notify-<pid>.py).
Canonical launch (minimal mode)
bash
cat > /tmp/codex-full-test-prompt.txt << 'EOF'
# ~10 lines
# 1) use notify helper now
# 2) create a test artifact
# 3) sleep 70 + notify again
# 4) run several shell commands
# 5) return short structured report
EOF
python3 {baseDir}/run-task.py \
--task "$(cat /tmp/codex-full-test-prompt.txt)" \
--project /tmp/codex-e2e-project \
--session "agent:main:main:<thread|topic>:<THREAD_ID>" \
--validate-only
nohup python3 {baseDir}/run-task.py \
--task "$(cat /tmp/codex-full-test-prompt.txt)" \
--project /tmp/codex-e2e-project \
--session "agent:main:main:<thread|topic>:<THREAD_ID>" \
--timeout 900 \
> /tmp/codex-full-test.log 2>&1 &
Examples
WhatsApp: Create a tool
bash
nohup python3 {baseDir}/run-task.py \
-t "Create a Python CLI tool that converts markdown to HTML with syntax highlighting. Save as convert.py" \
-p ~/projects/md-converter \
-s "agent:main:whatsapp:group:120363425246977860@g.us" \
> /tmp/codex-run.log 2>&1 &
Telegram Threaded Mode: Mid-task updates from Codex
run-task.py automatically creates an on-disk notification script before launching Codex, so Codex can send progress updates without seeing bot tokens in the prompt.
bash
cat > /tmp/codex-prompt.txt << 'EOF'
STEP 1: Write analysis to /tmp/report.txt.
After step 1, send a progress notification using the script from the
automation context above.
STEP 2: Write summary to /tmp/summary.txt.
EOF
nohup python3 {baseDir}/run-task.py \
--task "$(cat /tmp/codex-prompt.txt)" \
--project ~/projects/my-project \
--session "agent:main:main:<thread|topic>:<THREAD_ID>" \
--timeout 1800 \
> /tmp/codex-run.log 2>&1 &
Never embed bot tokens or raw curl commands in the task prompt.
Quick reference: launching from a Telegram DM thread (minimal mode)
Use --session-label to give sessions human-readable names for easier tracking.
Listing Recent Sessions
python
from session_registry import list_recent_sessions, find_session_by_label
recent = list_recent_sessions(hours=72)
for session in recent:
print(f"{session['thread_id']}: {session['label']} ({session['status']})")
Or manually inspect:
bash
cat ~/.openclaw/codex_sessions.json
When to Resume vs Start Fresh
Resume when:
you need context from previous conversation
building on previous research/analysis
continuing interrupted work
Start fresh when:
unrelated task
you want a clean slate
previous context may cause confusion
Resume Failure Handling
If a thread_id is invalid or expired:
error message sent to channel with suggestion to start fresh
process exits cleanly
check stderr in /tmp/codex-run.log
Common resume failures:
invalid thread_id
expired/non-resumable session
session from unrelated context or wrong project expectation
Example Workflow
Step 1: Initial research
bash
write /tmp/research-prompt.txt with "Research the codebase architecture for project X"
nohup python3 {baseDir}/run-task.py \
--task "$(cat /tmp/research-prompt.txt)" \
--project ~/projects/project-x \
--session "agent:main:main:<thread|topic>:<THREAD_ID>" \
--session-label "Project X architecture research" \
> /tmp/codex-run.log 2>&1 &
Codex CLI Task next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
Codex CLI Task compared with similar skills
Skill
Stars
Used in
Tokens
Auto-check
Licence
Repo updated
Codex CLI Task this skillLeoYeAI/openclaw-master-skills
End-to-end typed notification infrastructure for Node.js — typed catalog of email, SMS, push, web push, WhatsApp, Slack, Discord, Telegram, and GitHub notifications with provider-agnostic transports.
Prove user-visible OpenClaw Telegram behavior on Telegram's Test Server with Convex-leased team credentials; drive real-user turns and record messages, edits, deletions, reactions, typing, or rich…
Verify lemon features against a running (or disposable) instance using the cheapest sufficient tier: DIRECT (attach/RPC + control-plane WS + bus observation, no Telegram), FAKE TELEGRAM (hermetic…
Manages pipelines on a DevOps quality and efficiency platform through its OpenAPI: list workspaces and templates, create, update, run and cancel pipelines, and read run records.
Patches OpenClaw's Feishu extension so an edited document triggers an isolated agent session that reads the doc and replies inline, turning it into a live chat space.
Multi-context memory management system for OpenClaw agents with group-isolated storage, global shared memory, workspace organization, and group-specific skills isolation.
Runs a brand's AI-search visibility work end to end: diagnosing how AI platforms represent it, repositioning it, producing AI-optimized content and monitoring ongoing mentions.
Installs and authenticates the gws CLI, then automates Gmail, Drive, Sheets, Calendar, Docs, Chat and Tasks with ready-made recipes, persona bundles and security audits.
Runs four advisor roles, a fitness coach, nutritionist, data analyst and TCM practitioner, to build a health profile and track workouts, diet and wellness over time.
Launch OpenAI Codex CLI async in background with automatic delivery to Telegram/WhatsApp. Codex CLI Task is an agent skill from LeoYeAI/openclaw-master-skills. Launch OpenAI Codex CLI async in background with automatic delivery to Telegram/WhatsApp.
Run `npx skills add LeoYeAI/openclaw-master-skills --skill codex-cli-task -a claude-code`. Or copy the skill folder (skills/codex-cli-task in LeoYeAI/openclaw-master-skills) into .claude/skills/codex-cli-task in your project. Claude Code loads it when a task matches its description.
How do I install Codex CLI Task in Codex?
Run `npx skills add LeoYeAI/openclaw-master-skills --skill codex-cli-task -a codex`. Or copy the skill folder (skills/codex-cli-task in LeoYeAI/openclaw-master-skills) into .agents/skills/codex-cli-task in your project. Codex loads it when a task matches its description.
Can I use Codex CLI Task in Cursor, Gemini CLI or GitHub Copilot?
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add LeoYeAI/openclaw-master-skills --skill codex-cli-task -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/codex-cli-task, .gemini/skills/codex-cli-task, .github/skills/codex-cli-task and .opencode/skills/codex-cli-task in your project.
What does Codex CLI Task need to run?
Going by SKILL.md and its folder, Codex CLI Task needs Python and a shell for the scripts in its folder, the command-line tools its instructions call (python3 and codex) and credentials named SESSION_KEY. Our summary lists: Python 3; A Bash shell.
Does Codex CLI Task access the network?
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Is Codex CLI Task safe to install?
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
What licence does Codex CLI Task use?
Codex CLI Task is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
How many tokens does Codex CLI Task use?
About 7.1k tokens (SKILL.md is roughly 28k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 816 tokens, read only when the agent opens those files.
What are the alternatives to Codex CLI Task?
Skills that share tags, products or a category with Codex CLI Task: Better Notify (better-notify/better-notify, 313 stars), Code That Fits In Your Head (CodeAlive-AI/ai-driven-development, 157 stars), TDD Workflow (hellangleZ/burn-in-cceverywhere-ralph, 112 stars) and Playwright Page Objects (bartstc/vite-ts-react-template, 122 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Who maintains Codex CLI Task?
LeoYeAI (a GitHub user) maintains it in LeoYeAI/openclaw-master-skills, which has 2,159 GitHub stars. The repository holds 972 skills in this directory. The repository was last updated on July 20, 2026.