Best use case
/add-codex is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Add Codex CLI as an alternative NanoClaw agent runtime.
Teams using /add-codex should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/add-codex/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How /add-codex Compares
| Feature / Agent | /add-codex | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Add Codex CLI as an alternative NanoClaw agent runtime.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# /add-codex
Add Codex CLI as an alternative NanoClaw agent runtime.
## 1) Overview
NanoClaw supports two agent runtimes:
- `claude` (default) — Claude Agent SDK
- `codex` — Codex CLI
Codex is invoked as:
```bash
codex --full-auto exec "<prompt>"
```
## 2) Prerequisites
- Codex CLI installed and available on PATH:
- `codex --help` should work
- Codex CLI authenticated (OAuth configured):
- Run `codex` once interactively and complete login
- Ensure NanoClaw runs under the same user HOME where Codex stores credentials
## 3) Runtime selection + priority
Priority order:
1. **Per-group config** (`data/registered_groups.json` → `containerConfig.env.AGENT_RUNTIME`)
2. **Database setting** (`settings` table key `agent_runtime`)
3. **Environment variable** (`AGENT_RUNTIME`)
4. **Default** (`claude`)
### Per-group override (WhatsApp groups)
```json
{
"containerConfig": {
"env": {
"AGENT_RUNTIME": "codex"
}
}
}
```
### Global (env)
```bash
export AGENT_RUNTIME=codex
```
Run:
```bash
AGENT_RUNTIME=codex npm run dev
```
### Hot-swap via Discord command (persists in DB)
From any allowed Discord channel/DM:
- `!runtime status` → show current runtime
- `!runtime codex` → switch to Codex
- `!runtime claude` → switch back to Claude
This updates the `settings` table (`agent_runtime`) and survives restarts.
## 4) Testing
1. Verify Codex is available:
- `codex --help`
2. Start NanoClaw with Codex (or use `!runtime codex`)
3. Send a Discord or WhatsApp message and confirm:
- NanoClaw replies with Codex output
- No `codex: command not found` errors in logs
## 5) Codex trust configuration
NanoClaw runs Codex from `groups/<folder>/` directories. Codex CLI only executes in
trusted paths configured in `~/.codex/config.toml`. Add the NanoClaw groups paths:
```toml
[projects."/path/to/nanoclaw/groups"]
trust_level = "trusted"
[projects."/path/to/nanoclaw/groups/discord"]
trust_level = "trusted"
```
Use the exact absolute paths for your install.
## 6) Troubleshooting
- **`codex: command not found`**
- Install Codex CLI and ensure it is on PATH for the NanoClaw process.
- **OAuth / login errors**
- Ensure NanoClaw runs under the same user account that completed `codex` login.
- Avoid overriding `HOME` for Codex.
- **Codex returns empty output**
- Check that `groups/<folder>/` directories are configured as trusted in
`~/.codex/config.toml`.
- **Empty response / non-zero exit**
- Check `groups/<folder>/logs/agent-*.log`
- Run with `LOG_LEVEL=debug` to increase verbosity.Related Skills
setup
Run initial NanoClaw setup. Use when user wants to install dependencies, authenticate WhatsApp, register their main channel, or start the background services. Triggers on "setup", "install", "configure nanoclaw", or first-time setup requests.
setup-linux
Set up NanoClaw on Linux (Ubuntu/Debian recommended). Installs deps, configures .env, optional WhatsApp auth, and optional systemd service.
debug
Debug container agent issues. Use when things aren't working, container fails, authentication problems, or to understand how the container system works. Covers logs, environment variables, mounts, and common issues.
customize
Add new capabilities or modify NanoClaw behavior. Use when user wants to add channels (Telegram, Slack, email input), change triggers, add integrations, modify the router, or make any other customizations. This is an interactive skill that asks questions to understand what the user wants.
add-gmail
Add Gmail integration to NanoClaw. Can be configured as a tool (agent reads/sends emails when triggered from WhatsApp) or as a full channel (emails can trigger the agent, schedule tasks, and receive replies). Guides through GCP OAuth setup and implements the integration.
add-discord
Enable Discord as a NanoClaw channel (works alongside WhatsApp or Discord-only).
codex-review
Professional code review with auto CHANGELOG generation, integrated with Codex AI. Use when you want professional code review before commits, you need automatic CHANGELOG generation, or reviewing large-scale refactoring.
codex
OpenAI Codex CLI wrapper — three modes. Code review: independent diff review via codex review with pass/fail gate. Challenge: adversarial mode that tries to break your code. Consult: ask codex anything with session continuity for follow-ups. The "200 IQ autistic developer" second opinion. Use when asked to "codex review", "codex challenge", "ask codex", "second opinion", or "consult codex". (gstack) Voice triggers (speech-to-text aliases): "code x", "code ex", "get another opinion".
codex
Use when the user asks to run Codex CLI (codex exec, codex resume) or references OpenAI Codex for code analysis, refactoring, or automated editing. Uses GPT-5.2 by default for state-of-the-art software engineering.
codex-review
Professional code review with auto CHANGELOG generation, integrated with Codex AI
codex-cli-guardian
Codex CLI 会话守护者。管理 API Key、任务执行与结果摘要。提供后台模式运行、API Key 验证、会话锁定与PID追踪等功能。
cpa-codex-auth-sweep-cliproxy
通过 CLI Proxy Management API 拉取 Codex 认证文件并高并发探活扫描。适用于「扫号」「清死号」「清理 Codex 401」场景;仅在用户明确确认后可删除 401。执行前必须提供 base_url 与 management_key。安全限制:默认仅允许 https://chatgpt.com 作为 probe 主机,非白名单目标需显式危险确认。