codex-cc
Delegates coding tasks from Codex to local Claude Code in print mode while preserving Claude's normal runtime customizations by default. Use when: (1) You want Codex to call Claude Code locally, (2) You need Claude-side skills, plugins, MCP servers, custom commands, CLAUDE.md rul
Install
npx skills add https://github.com/Dianel555/DSkills/tree/main/skills/codex-cc
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install dianel555-dskills@llmmart
git clone https://github.com/Dianel555/DSkills.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole dianel555/dskills collection as a plugin from our marketplace. Git is the plain clone.
README
codex-cc
A Codex-facing DSkills bridge that shells out to local Claude Code and returns a stable JSON envelope.
Overview
codex-cc is for the inverse direction of cc-codex: Codex calls Claude Code locally.
By default the bridge preserves Claude Code's normal runtime behavior. It does not force --safe-mode, --bare, --disable-slash-commands, or --strict-mcp-config, so trusted-workspace customizations such as CLAUDE.md, skills, plugins, MCP servers, custom commands, and rules continue to load the same way Claude normally would.
Two runtime caveats still come from Claude Code itself:
claude -pskips the interactive trust dialog, so only use this in directories you already trust.- Invalid settings files may be silently ignored in print mode, so if inheritance seems missing, validate the workspace
.claudeconfiguration first.
Installation
Copy this skill to your Codex skills directory:
cp -r skills/codex-cc ~/.codex/skills/
The bridge expects a working local Claude Code installation available as claude on PATH.
Usage
Basic
python scripts/claude_bridge.py --cd "/path/to/project" --PROMPT "Analyze the auth flow"
Resume a Claude session
# Initial turn
python scripts/claude_bridge.py --cd "/project" --PROMPT "Review the failing tests"
# Follow-up turn using the returned SESSION_ID
python scripts/claude_bridge.py --cd "/project" --SESSION_ID "uuid-from-response" --PROMPT "Now write the minimal fix"
Permission overrides are explicit
python scripts/claude_bridge.py --cd "/project" --PROMPT "Run the test suite" --permission-mode plan
python scripts/claude_bridge.py --cd "/project" --PROMPT "Run unattended in sandbox" --dangerously-skip-permissions
Claude management passthrough
python scripts/claude_bridge.py mcp list
python scripts/claude_bridge.py plugin list
python scripts/claude_bridge.py plugin marketplace list
Parameters
| Parameter | Required | Description |
|---|---|---|
--PROMPT |
Yes* | Task instruction for Claude Code |
--cd |
Yes* | Workspace root used for both process cwd and --add-dir |
--SESSION_ID |
No | Resume an existing Claude conversation |
--model |
No | Claude model override. Aliases (e.g. haiku, sonnet) are resolved by Claude Code against the active endpoint, so a custom ANTHROPIC_BASE_URL may map them to a differently-named backend model |
--permission-mode |
No | Claude permission mode override |
--dangerously-skip-permissions |
No | Opt-in permission bypass |
--timeout |
No | Bridge-level timeout in seconds; omit it to wait without a bridge deadline |
--stream-file |
No | Raw Claude stream-json JSONL destination; omit it to create a temporary file |
--return-all-messages |
No | Include all parsed stream records in the returned envelope |
* Not required for mcp / plugin passthrough invocations.
Output Format
Successful task execution:
{
"success": true,
"SESSION_ID": "uuid",
"agent_messages": "Claude response text",
"stream_file": "/tmp/claude_stream_....jsonl",
"stderr": "optional diagnostic text"
}
The bridge reads Claude's streaming output incrementally and treats the final
result record as the authoritative completion message. Intermediate
assistant records remain available in stream_file and, when
--return-all-messages is set, in all_messages.
When the bridge deadline fires, the error also reports the last transport-level
retry it observed (for example claude timed out after 300.0s (last transport error: HTTP 502 server_error, attempt 1/10)), so an upstream or proxy outage is
distinguishable from a genuinely slow task.
Failed task execution:
{
"success": false,
"SESSION_ID": "uuid-if-claude-was-launched",
"error": "Failure reason",
"stream_file": "/tmp/claude_stream_....jsonl",
"stderr": "optional diagnostic text"
}
Passthrough output:
{
"success": true,
"output": "...",
"error": "",
"returncode": 0
}
Skill manifest
Quick Start
python scripts/claude_bridge.py --cd "/path/to/project" --PROMPT "Analyze auth flow"
Output: JSON with success, SESSION_ID, agent_messages, stream_file
(the raw Claude JSONL stream), and optional all_messages, stderr, or error.
Runtime Contract
- Default execution uses
claude -pand does not force--safe-mode,--bare,--disable-slash-commands, or--strict-mcp-config. - Claude Code therefore keeps its normal loading path for trusted-workspace customizations such as
CLAUDE.md, skills, plugins, MCP servers, custom commands, and rules. claude -pskips the interactive trust dialog and silently ignores invalid settings files, so use this only in workspaces you already trust and whose.claudesettings already validate.- The bridge requests
stream-json, persists each record immediately, and only treats Claude's finalresultrecord as a completed answer. Intermediateassistantrecords never mask a failed or incomplete turn. - On Windows the PROMPT is delivered through stdin when
clauderesolves to a.cmd/.batshim, so the prompt never passes through cmd.exe quoting and cannot hit the command-line length limit.
Parameters
usage: claude_bridge.py [-h] --PROMPT PROMPT --cd CD [--SESSION_ID SESSION_ID]
[--model MODEL]
[--permission-mode {,acceptEdits,auto,bypassPermissions,manual,dontAsk,plan}]
[--dangerously-skip-permissions] [--timeout TIMEOUT]
[--stream-file STREAM_FILE] [--return-all-messages]
{mcp,plugin} ...
options:
--PROMPT PROMPT Instruction for the task to send to Claude Code.
--cd CD Workspace root for Claude Code (cwd + --add-dir).
--SESSION_ID SESSION_ID Resume a conversation by session UUID.
--model MODEL Claude model override. Aliases resolve against the active endpoint.
--permission-mode ... Claude permission mode override.
--dangerously-skip-permissions Bypass Claude permission checks.
--timeout TIMEOUT Bridge-level timeout in seconds. Omit for no bridge deadline.
--stream-file STREAM_FILE Raw Claude stream-json JSONL destination.
--return-all-messages Include parsed stream records in the result.
subcommands:
mcp Thin passthrough to `claude mcp`.
plugin Thin passthrough to `claude plugin`.
Sessions
Capture SESSION_ID from the first successful response and reuse it for follow-ups.
SESSION_ID is empty when a run never established a session (claude produced no stream output):
resume only with an id the bridge actually returned.
# New Claude session
python scripts/claude_bridge.py --cd "/project" --PROMPT "Inspect failing tests"
# Resume the same Claude session
python scripts/claude_bridge.py --cd "/project" --SESSION_ID "uuid-from-response" --PROMPT "Now propose the fix"
Passthrough
python scripts/claude_bridge.py mcp list
python scripts/claude_bridge.py plugin list
Files (dskills)
-
scripts
-
claude_bridge.py 21 KB
Loading…
-
-
tests
-
test_claude_bridge.py 24.7 KB
Loading…
-
-
README.md 4 KB
# codex-cc A Codex-facing DSkills bridge that shells out to local Claude Code and returns a stable JSON envelope. ## Overview `codex-cc` is for the inverse direction of `cc-codex`: Codex calls Claude Code locally. By default the bridge preserves Claude Code's normal runtime behavior. It does not force `--safe-mode`, `--bare`, `--disable-slash-commands`, or `--strict-mcp-config`, so trusted-workspace customizations such as `CLAUDE.md`, skills, plugins, MCP servers, custom commands, and rules continue to load the same way Claude normally would. Two runtime caveats still come from Claude Code itself: - `claude -p` skips the interactive trust dialog, so only use this in directories you already trust. - Invalid settings files may be silently ignored in print mode, so if inheritance seems missing, validate the workspace `.claude` configuration first. ## Installation Copy this skill to your Codex skills directory: ```bash cp -r skills/codex-cc ~/.codex/skills/ ``` The bridge expects a working local Claude Code installation available as `claude` on `PATH`. ## Usage ### Basic ```bash python scripts/claude_bridge.py --cd "/path/to/project" --PROMPT "Analyze the auth flow" ``` ### Resume a Claude session ```bash # Initial turn python scripts/claude_bridge.py --cd "/project" --PROMPT "Review the failing tests" # Follow-up turn using the returned SESSION_ID python scripts/claude_bridge.py --cd "/project" --SESSION_ID "uuid-from-response" --PROMPT "Now write the minimal fix" ``` ### Permission overrides are explicit ```bash python scripts/claude_bridge.py --cd "/project" --PROMPT "Run the test suite" --permission-mode plan python scripts/claude_bridge.py --cd "/project" --PROMPT "Run unattended in sandbox" --dangerously-skip-permissions ``` ### Claude management passthrough ```bash python scripts/claude_bridge.py mcp list python scripts/claude_bridge.py plugin list python scripts/claude_bridge.py plugin marketplace list ``` ## Parameters | Parameter | Required | Description | |-----------|----------|-------------| | `--PROMPT` | Yes* | Task instruction for Claude Code | | `--cd` | Yes* | Workspace root used for both process `cwd` and `--add-dir` | | `--SESSION_ID` | No | Resume an existing Claude conversation | | `--model` | No | Claude model override. Aliases (e.g. `haiku`, `sonnet`) are resolved by Claude Code against the active endpoint, so a custom `ANTHROPIC_BASE_URL` may map them to a differently-named backend model | | `--permission-mode` | No | Claude permission mode override | | `--dangerously-skip-permissions` | No | Opt-in permission bypass | | `--timeout` | No | Bridge-level timeout in seconds; omit it to wait without a bridge deadline | | `--stream-file` | No | Raw Claude `stream-json` JSONL destination; omit it to create a temporary file | | `--return-all-messages` | No | Include all parsed stream records in the returned envelope | `*` Not required for `mcp` / `plugin` passthrough invocations. ## Output Format Successful task execution: ```json { "success": true, "SESSION_ID": "uuid", "agent_messages": "Claude response text", "stream_file": "/tmp/claude_stream_....jsonl", "stderr": "optional diagnostic text" } ``` The bridge reads Claude's streaming output incrementally and treats the final `result` record as the authoritative completion message. Intermediate `assistant` records remain available in `stream_file` and, when `--return-all-messages` is set, in `all_messages`. When the bridge deadline fires, the error also reports the last transport-level retry it observed (for example `claude timed out after 300.0s (last transport error: HTTP 502 server_error, attempt 1/10)`), so an upstream or proxy outage is distinguishable from a genuinely slow task. Failed task execution: ```json { "success": false, "SESSION_ID": "uuid-if-claude-was-launched", "error": "Failure reason", "stream_file": "/tmp/claude_stream_....jsonl", "stderr": "optional diagnostic text" } ``` Passthrough output: ```json { "success": true, "output": "...", "error": "", "returncode": 0 } ``` -
ruff.toml 656 B
Loading… -
SKILL.md 3.6 KB
--- name: codex-cc description: | Delegates coding tasks from Codex to local Claude Code in print mode while preserving Claude's normal runtime customizations by default. Use when: (1) You want Codex to call Claude Code locally, (2) You need Claude-side skills, plugins, MCP servers, custom commands, CLAUDE.md rules, or workspace settings to stay active, (3) You want resumable Claude sessions from Codex via SESSION_ID, (4) You need thin `claude mcp` / `claude plugin` passthrough from the same bridge. --- ## Quick Start ```bash python scripts/claude_bridge.py --cd "/path/to/project" --PROMPT "Analyze auth flow" ``` **Output:** JSON with `success`, `SESSION_ID`, `agent_messages`, `stream_file` (the raw Claude JSONL stream), and optional `all_messages`, `stderr`, or `error`. ## Runtime Contract - Default execution uses `claude -p` and does **not** force `--safe-mode`, `--bare`, `--disable-slash-commands`, or `--strict-mcp-config`. - Claude Code therefore keeps its normal loading path for trusted-workspace customizations such as `CLAUDE.md`, skills, plugins, MCP servers, custom commands, and rules. - `claude -p` skips the interactive trust dialog and silently ignores invalid settings files, so use this only in workspaces you already trust and whose `.claude` settings already validate. - The bridge requests `stream-json`, persists each record immediately, and only treats Claude's final `result` record as a completed answer. Intermediate `assistant` records never mask a failed or incomplete turn. - On Windows the PROMPT is delivered through stdin when `claude` resolves to a `.cmd`/`.bat` shim, so the prompt never passes through cmd.exe quoting and cannot hit the command-line length limit. ## Parameters ```text usage: claude_bridge.py [-h] --PROMPT PROMPT --cd CD [--SESSION_ID SESSION_ID] [--model MODEL] [--permission-mode {,acceptEdits,auto,bypassPermissions,manual,dontAsk,plan}] [--dangerously-skip-permissions] [--timeout TIMEOUT] [--stream-file STREAM_FILE] [--return-all-messages] {mcp,plugin} ... options: --PROMPT PROMPT Instruction for the task to send to Claude Code. --cd CD Workspace root for Claude Code (cwd + --add-dir). --SESSION_ID SESSION_ID Resume a conversation by session UUID. --model MODEL Claude model override. Aliases resolve against the active endpoint. --permission-mode ... Claude permission mode override. --dangerously-skip-permissions Bypass Claude permission checks. --timeout TIMEOUT Bridge-level timeout in seconds. Omit for no bridge deadline. --stream-file STREAM_FILE Raw Claude stream-json JSONL destination. --return-all-messages Include parsed stream records in the result. subcommands: mcp Thin passthrough to `claude mcp`. plugin Thin passthrough to `claude plugin`. ``` ## Sessions Capture `SESSION_ID` from the first successful response and reuse it for follow-ups. `SESSION_ID` is empty when a run never established a session (claude produced no stream output): resume only with an id the bridge actually returned. ```bash # New Claude session python scripts/claude_bridge.py --cd "/project" --PROMPT "Inspect failing tests" # Resume the same Claude session python scripts/claude_bridge.py --cd "/project" --SESSION_ID "uuid-from-response" --PROMPT "Now propose the fix" ``` ## Passthrough ```bash python scripts/claude_bridge.py mcp list python scripts/claude_bridge.py plugin list ```
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.