
Claude Code 2.1.142 + Codex remote-control: orchestrating multi-agent workflows with --agents
Claude Code 2.1.142 introduces --agents and a remote-control API that lets you delegate sub-tasks to other agents (including Codex) from inside a Claude session. We map the architecture, the safety model, and the practical patterns.

中澤 圭志
@keishi_nakazawaSales Claw maintainer

Key Facts
Release
Claude Code 2.1.142 (2026-05-15)
Capability
--agents flag + remote control API for cross-agent orchestration
"Claude Code's claude agents and Codex CLI's codex remote-control dropped the same week. Both expose headless programmatic control — but how far does AI sales automation actually accelerate when you combine them?" This article walks through a Sales Claw-maintainer-eye design guide for that combination, using Claude Code 2.1.142 (2026-05-14) and Codex CLI 0.130.0 (2026-05-11) official Changelogs / GitHub Releases / App Server Docs as primary sources.
On 2026-05-11, Codex CLI 0.130.0 added codex remote-control as "a simpler entrypoint for starting a headless, remotely controllable app-server." Three days later, on 2026-05-14, Claude Code 2.1.142 added eight new flags to claude agents so dispatched background sessions can be fully isolated per session. In a single week, both CLIs evolved in the same direction: "don't use the TUI — control them programmatically from an external process."
This article covers how to combine these two CLIs as a single parallel headless agent platform. The summary:
- Claude Code = strong at MCP, local file edits, Plan mode, and
--permission-modeisolation. Useclaude agents --add-dir ... --mcp-config ... --permission-mode ... --model ...to launch fully isolated per-session workers. - Codex CLI = strong at JSON-RPC 2.0 app-server.
codex remote-controlexposes 100+ methods likethread/start,turn/start,command/exec,fs/readFilefor external processes. - Combined: Claude Code owns "local edit / MCP / permission control," Codex owns "JSON-RPC programmatic execution / image generation (gpt-image-2 etc.)." A two-LLM cross-check (Claude Opus 4.7 + GPT-5.x) becomes practical.
Primary sources: Claude Code official Changelog, GitHub Releases (v2.1.142), Codex CLI Changelog (developers.openai.com/codex/changelog), Codex App Server Docs (developers.openai.com/codex/app-server), Codex Non-interactive Mode Docs. For the Claude Code 2.1.142 standalone deep-dive, see the 2.1.142 8-flag + Fast Mode Opus 4.7 article.
1. Why combine claude agents and codex remote-control now?
May 2026 in AI coding CLIs: Claude Code shipped 2.1.139 → 2.1.140 → 2.1.141 → 2.1.142 in 72 hours, and Codex CLI went from 0.129.0 (Vim mode etc.) → 0.130.0 (remote-control etc.). Both products are layering "automation / pipeline / parallel jobs" capabilities on top of their original interactive TUIs.
![Same-week release timeline for Claude Code and Codex CLI from May 1 to May 15, 2026. Top half: Claude Code 2.1.x (2.1.137 → 2.1.139 [5/12 major: /goal + Agent View] → 2.1.140 [5/12] → 2.1.141 [5/13] → 2.1.142 [5/14 8 flags + Fast Mode Opus 4.7]). Bottom half: Codex CLI (0.128 → 0.129.0 [5/7 Vim mode + extended Chrome] → 0.130.0 [5/8-11 remote-control + plugin sharing] → 0.131.0-alpha [5/12-15 pre-release]). The major releases cluster in the same 8-day window of May 7–14.](/images/blog/diagram-2026-05-15-claude-codex-release-timeline.png)
"Two major CLIs evolved in the same direction in the same week" is more than coincidence. Anthropic and OpenAI each independently are moving their product position from "a CLI a single developer types at" to "a platform that schedules many parallel jobs." For AI sales automation that takes long-running, multi-pipeline, multi-model setups as table stakes, combining them got a step more practical.
2. The same-week changes (per official docs)
Claude Code 2.1.142 — 8 claude agents flags
Claude Code 2.1.142 (2026-05-14 22:55 UTC) added 8 new flags to claude agents for launching dispatched background sessions:
--add-dir <path>— additional working directories (repeatable)--settings <path>— settings file for this session only--mcp-config <path>— MCP config for this session only--plugin-dir <path>— plugin directory for this session only--permission-mode <mode>— default / ask / acceptEdits / bypassPermissions / plan--model <model>— model for this session (haiku / sonnet / opus)--effort <level>— reasoning effort (high / medium / low)--dangerously-skip-permissions— fully bypass permissions (sandbox / trusted only)
Each had been available to claude in foreground mode; 2.1.142 carries them to dispatched background sessions. The same release promotes Fast Mode default from Opus 4.6 → Opus 4.7 and removes the 60-second timeout cap on remote HTTP / SSE MCP.
Codex CLI 0.130.0 — codex remote-control and the App Server
Codex CLI 0.130.0 (2026-05-08 ~ 11) introduced codex remote-control as the headless control entrypoint.
The backing codex app-server uses JSON-RPC 2.0: stdio newline-delimited JSON (JSONL) by default, with experimental WebSocket via --listen ws://127.0.0.1:4500. The Codex App Server Docs publish 100+ methods. Key categories:
- Thread management:
thread/start,thread/resume,thread/fork,thread/list,thread/archive - Turn control:
turn/start,turn/steer,turn/interrupt - Models / features:
model/list,experimentalFeature/list - Execution:
command/exec,command/exec/write,command/exec/resize - Skills / apps:
skills/list,app/list,plugin/list - Filesystem:
fs/readFile,fs/writeFile,fs/watch - Auth:
account/read,account/login/start,account/logout
Stateless codex exec "..." (pipeline-friendly) and stateful, programmable codex remote-control + JSON-RPC co-exist as two automation layers inside the same Codex CLI.
| 項目 | Claude Code 2.1.142 (claude agents) | Codex CLI 0.130.0 (codex remote-control) |
|---|---|---|
| Automation entrypoint | claude agents <flags> --bg | codex remote-control / codex exec |
| Protocol | CLI flags + file-based config | JSON-RPC 2.0 (JSONL / WebSocket) |
| Config isolation | --settings / --mcp-config / --plugin-dir | thread/start parameters |
| Permission control | --permission-mode + Hooks | --sandbox + per-thread approval policy |
| Models | Claude (Opus 4.7 / Sonnet 4.6 / Haiku 4.5) | GPT-5.x / Codex family |
| Local file edits | Strong (Edit / Write) | OK (via fs/writeFile) |
| Image generation | Indirect (separate CLI) | Direct (codex exec with gpt-image-2) |
| MCP integration | Per-session via --mcp-config | OK (plugin/list via App Server) |
3. Three architectural patterns for headless parallel agents

Pattern A: role split
The simplest and most practical. Claude Code is strong at local file edits and MCP integration; Codex CLI is strong at image generation (gpt-image-2) and external-API pipelines. Split by workload.
- Claude Code handles: sales copy generation / editing, company info via MCP scrape, form-submit logic code generation, design in Plan mode
- Codex CLI handles: header image generation (
codex exec --full-auto -m gpt-image-2 ...), data via external APIs, JSON-RPC-driven image conversion as independent jobs
Pattern B: cross-check
Send the same task to both Claude and Codex; compare outputs. For sales copy where "subtle brand-voice drift" and "missed banned terms" affect quality, two-LLM cross-check is effective. Plug it in as an additional layerin Sales Claw's pre-send checks.
- Use Claude Haiku 4.5 as the judge to keep cost low
- Run the same judgment with GPT-5.x via Codex
- Both PASS → continue; diff → drop into
awaiting_approvalwith audit-log entry
Pattern C: pipeline chain
Claude's output feeds Codex's input (or vice versa). Pipe codex exec --json JSONL output into Claude Code, or pass Claude Code's --output-format json result to thread/start on the Codex App Server.
# Pattern C example: Claude drafts 5 copy candidates → Codex brand-checks them
claude agents \
--add-dir ./lines/btob-saas \
--settings ./lines/btob-saas/.claude/settings.json \
--permission-mode acceptEdits \
--model sonnet \
--output-format json > drafts.json
# Brand-check job on Codex side
codex exec --json --ephemeral \
--sandbox workspace-write \
"Read drafts.json. Run each draft against the Sales Claw brand guidelines. Output PASS/FAIL JSON." \
> brand-check.jsonl| 項目 | Claude only | Claude + Codex combined |
|---|---|---|
| Sales copy generation | Claude Sonnet 4.6 | Same + Codex cross-check for banned terms |
| Image generation | Needs separate external API call | codex exec calls gpt-image-2 directly |
| Local code editing | Claude is strong by default | Same (Codex assists) |
| MCP server integration | Per-session via --mcp-config | Same (plugin/list on Codex side) |
| Programmable control | CLI flags + stdio | Same + JSON-RPC 2.0 (Codex) |
| Cost | Anthropic API only | Anthropic + OpenAI both billed |
4. Sales Claw integration sketch
Sales Claw is OSS that lowers misfire and policy-violation risk through policy control, pre-send checks, do-not-contact detection, CAPTCHA-on-detect stop, rate limits, audit logs, and automatic stop conditions. Adding Codex CLI as a secondary backend alongside the existing Claude Code path lets one dashboard expose image generation and copy cross-check in addition to the standard flow.
Setup
# 1. Install Claude Code 2.1.142
npm install -g @anthropic-ai/claude-code@latest
claude --version
# → 2.1.142 or newer
# 2. Install Codex CLI 0.130.0
npm install -g @openai/codex@latest
codex --version
# → 0.130.0 or newer
# 3. Sales Claw auth
# Register both Anthropic and OpenAI API keys in ~/.sales-claw/credentials
# (Configurable via the Sales Claw dashboard settings UI)Launch script — 3 pipelines with two-LLM
Per-pipeline assignment: Claude Code as Worker, Codex as image-gen / cross-checker. See Workflow overview for the broader context.
# Pipeline A: B2B SaaS / Claude as Worker, Codex for image gen
claude agents \
--add-dir ~/work/sales-claw/lines/btob-saas \
--settings ~/work/sales-claw/lines/btob-saas/.claude/settings.json \
--mcp-config ~/work/sales-claw/lines/btob-saas/.claude/mcp.json \
--permission-mode acceptEdits \
--model sonnet \
--effort high \
--bg
# Codex remote-control runs as a separate listening process
codex remote-control --listen ws://127.0.0.1:4500 &
# Pipeline A's copy cross-checker hits Codex App Server via JSON-RPC
# → thread/start → turn/start → collect JSONLDriving the Codex App Server via JSON-RPC
Minimal TypeScript JSON-RPC client driving Codex App Server from a Sales Claw copy cross-checker:
// Within sales-claw, spawn Codex App Server as a sub-process
// JSONL over stdio
import { spawn } from 'node:child_process';
const codex = spawn('codex', ['remote-control'], { stdio: ['pipe', 'pipe', 'inherit'] });
let id = 1;
function rpc(method: string, params: Record<string, unknown>) {
const req = JSON.stringify({ jsonrpc: '2.0', id: id++, method, params }) + '\n';
codex.stdin.write(req);
}
// 1. Start a thread (sandbox = workspace-write, ephemeral)
rpc('thread/start', {
sandbox: 'workspace-write',
ephemeral: true,
workingDirectory: '/work/sales-claw/lines/btob-saas',
});
// 2. Submit a turn (run brand-check on 5 Claude-generated drafts)
rpc('turn/start', {
threadId: 'thread_abc',
input: 'Run brand-check on each of these 5 sales copy drafts and return PASS/FAIL JSON.\n\n' + JSON.stringify(drafts),
});
// 3. Receive JSONL events from stdout
codex.stdout.on('data', (chunk) => {
for (const line of chunk.toString().split('\n').filter(Boolean)) {
const msg = JSON.parse(line);
handleCodexMessage(msg);
}
});Sales Claw itself is free at the download page. The 1.2.x line plans GUI Codex CLI detection and credential registration; today, set up manually.
5. Cost of two-LLM operation and assumptions
Assumptions
- Targets: 1,000 companies/mo (Sales Claw Phase B)
- Claude judge: Haiku 4.5, $1 / MTok in, $5 / MTok out
- Claude worker: Sonnet 4.6, $3 / MTok in, $15 / MTok out
- Codex model: GPT-5.x, $2.5 / MTok in, $10 / MTok out (assumed)
- Codex image gen: gpt-image-2, $0.02–0.05 per image (medium-size)
- FX: 1 USD = 150 JPY
- Per-company tokens: ~12K in / ~1.5K out average
- Image gen: 30/mo (articles + headers)
- Variance: ±25%
Three-scenario comparison (estimate)


Where to add the second LLM
- Image generation → Codex — Claude Code has no built-in image gen.
codex exec -m gpt-image-2is simple and adds ~¥3,000–¥8,000/mo. - Copy cross-check → Codex only for banned-term detection — Running full copy quality through both LLMs costs 1.8×. A lightweight prompt that asks GPT-5.x to flag banned terms ("complete," "absolute," "revolution") adds ~¥5,000/mo.
- Company-info extraction → Claude only — MCP integration plus Sonnet 4.6 instruction-following is enough. Adding a second LLM here doesn't pay back.
6. Risks of autonomous operation — the "permission split across two paths" trap
Running two CLIs in parallel gives big headless / programmable wins. It also introduces a new risk: permission policy splits across two paths. Don't claim "safe" — lower risk structurally.
The dual-path permission risk
Claude Code builds pre-send checks via --permission-mode + Hooks. Codex CLI builds a different system via --sandbox + per-thread approval policy. Running both on one machine, it's easy to relax one side's guard while the other holds — creating the illusion of safety while leaving an open path.

Legal / compliance
- Japan's Specified Electronic Mail Act: auto-append the 4 required sender-info fields
- Terms compliance: skip pages marked "no sales / recruiting only / IR only"
- No CAPTCHA bypass: stop into
awaiting_approval, log on detect - Rate limiting: per-pipeline + global
- Opt-out: auto-insert "reply to opt out" in copy
- API terms: Anthropic and OpenAI both — image generation involving persons / logos / trademarks needs special care
Risks that remain
- One side's API hitting rate limits or outages — design Sales Claw to poll API status and auto-stop if either side is down
- Codex App Server's JSON-RPC endpoint (
--listen ws://127.0.0.1:4500) accidentally exposed externally — always bind localhost; confirm firewall - Disagreement between Claude and Codex on cross-check — document explicitly which result wins
- Image generation reproducing trademarks / persons / brand logos — always include "do not accurately reproduce logos" and "editorial illustration only" in the prompt
- Anthropic and OpenAI terms updates — review quarterly
7. Pre-production checklist
Before launching a Claude Code × Codex combined operation
- claude --version shows 2.1.142+, codex --version shows 0.130.0+
- Both Anthropic and OpenAI API keys are valid; monthly budget alerts set on both
- Documented which paths use two-LLM (image gen / banned-term detection / others)
- claude agents launches explicitly set --settings / --mcp-config / --permission-mode
- codex remote-control --listen binds to localhost (127.0.0.1)
- Production machines forbid both --dangerously-skip-permissions and --sandbox danger-full-access
- Compliance footer enabled (preferences.complianceFooter: true)
- CAPTCHA-on-detect stop into awaiting_approval is on
- action-log.json saves; audit log captures both Claude and Codex paths
- Per-pipeline and global rate limits set
- Auto-stop conditions defined for either-side API outages
- Image-gen prompts include "do not accurately reproduce official logos" and "editorial illustration only"
- Disagreement rule documented (e.g., Claude PASS + Codex FAIL → which wins?)
- 100-company sample compares Claude-only vs combined for cost and throughput
- Quarterly review process for Anthropic and OpenAI terms is in place
8. Bottom line — combine the two same-week-releases as one platform
Claude Code 2.1.142 (2026-05-14) and Codex CLI 0.130.0 (2026-05-11) added features in the same direction the same week: "from TUI to programmatic control." They are complementary. claude agents's 8 flags excel at "config isolation + permission split"; codex remote-control + JSON-RPC 2.0 excels at "programmable control + image-gen pipelines."
For workloads that take long-running, multi-pipeline, multi-model setups as table stakes — like AI sales automation — combining them is now practical. Choose role split (Pattern A), cross-check (B), or pipeline chain (C) based on your workload. Adding the second LLM only for image gen and banned-term detection is a balanced compromise between cost and quality.
Next action: npm install -g @anthropic-ai/claude-code@latest @openai/codex@latest and start with Pattern A — split image generation to Codex first. See Quick start and Workflow overview for setup, and the Claude Code 2.1.142 standalone deep-dive for the other side.


