Skip to content

Backends

The adapter's internal Codex protocol layer talks to a small ClaudeRuntime interface, so non-SDK Claude Code bridges can be selected without removing the default Agent SDK route.

BackendStatusStreamingApprovals / diffs
agent-sdk-sidecar (default)StableFull (text, reasoning, tools)Yes
agent-http / ChannelsExperimentalMessage-level deltasNo
agentapiExperimentalTerminal-derived textNo
claude-pExperimentalNone (one-shot)No
codex (native passthrough)StableNative CodexNative Codex

Switching routes

Install the host helper next to the shim:

bash
install -m 0755 scripts/claude-codex-mode ~/.local/bin/claude-codex-mode

It rewrites ~/.claude-codex/runtime.env, prepares the matching bridge daemon (agent-http / agentapi), stops the current app-server so Codex App reconnects into the new route, and provides readback commands:

bash
claude-codex-mode list                 # selectable modes; current marked *
claude-codex-mode set agent-http opus  # switch route, restart bridge with Opus
claude-codex-mode model opus           # keep route; update default/bridge model
claude-codex-mode status               # mode, bridge health, recent logs
claude-codex-mode logs adapter|agent-http|agentapi

Model switching

Model switching is exact per turn for the SDK runtime and claude-p (the adapter passes model directly). For agent-http / agentapi the bridge talks to a long-lived Claude Code session, so changing the model means restarting that bridge (claude-codex-mode model <alias>).

Native codex passthrough

In CLAUDE_CODEX_RUNTIME_TYPE=codex the shim launches the real Codex app-server, so the adapter is not in the process and cannot switch back from in-App controls. Use claude-codex-mode set codex / set agent-sdk-sidecar on the host and reconnect.

agent-http / Channels

Loads the bridge from $CLAUDE_CODEX_AGENT_HTTP_DIR (or ~/agent-http) but launches Claude Code from the thread cwd. Uses POST /message, GET /messages, GET /status, GET /events; streams message-level deltas only (no semantic tool / thinking / permission events).

bash
claude-codex-mode set agent-http opus

agentapi

Runs agentapi server --type=claude from the thread cwd and maps final agent text into Codex messages. No rich approval / file-change events (terminal-derived text only). Run claude-codex-mode trust if Claude's workspace-trust prompt appears.

bash
claude-codex-mode set agentapi opus

claude-p

Runs claude-p --output-format json --input-file ... per turn and emits the final assistant text. Not streaming, no turn/steer; defaults to one-shot turns (some claude-p builds replay results when combining --resume with --input-file).

bash
export CLAUDE_CODEX_RUNTIME_TYPE="claude-p"
export CLAUDE_CODEX_CLAUDE_P_COMMAND="claude-p"
# export CLAUDE_CODEX_CLAUDE_P_RESUME=1   # only after verifying --resume + --input-file

Released under the MIT License.