# Collaborating With Codex

> Delegates coding tasks to Codex CLI for prototyping, debugging, and code review. Use when needing algorithm implementation, bug analysis, or code quality feedback. Supports multi-turn sessions via SESSION_ID. Use when this capability is needed.

- Skill: `tomevault-io/collaborating-with-codex` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/collaborating-with-codex`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/collaborating-with-codex/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/collaborating-with-codex

---


## How to Invoke (CRITICAL)

**MUST use Bash tool with `run_in_background: true`:**

```bash
python /Users/jiabinfeng/Documents/work/go/q9jy-backend/.claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
  --cd "/Users/jiabinfeng/Documents/work/go/q9jy-backend" \
  --PROMPT "Your task description here"
```

**After launching, use `TaskOutput` to get results:**
```
TaskOutput: task_id=<returned_task_id>, block=true
```

**Output:** JSON with `success`, `SESSION_ID`, `agent_messages`, and optional `error`.

## Parameters

| Parameter | Required | Default | Description |
|-----------|----------|---------|-------------|
| `--PROMPT` | Yes | - | Task instruction to send to Codex |
| `--cd` | Yes | - | Workspace root directory (use absolute path) |
| `--sandbox` | No | `read-only` | `read-only` / `workspace-write` / `danger-full-access` |
| `--SESSION_ID` | No | - | Resume a previous session |
| `--return-all-messages` | No | False | Include full reasoning trace |
| `--image` | No | - | Attach image files (comma-separated) |

## Multi-turn Sessions

**Always capture `SESSION_ID`** from the first response for follow-up:

```bash
# Initial task
python /Users/jiabinfeng/Documents/work/go/q9jy-backend/.claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
  --cd "/Users/jiabinfeng/Documents/work/go/q9jy-backend" \
  --PROMPT "Analyze auth in backend/internal/handler/auth.go"

# Continue with SESSION_ID
python /Users/jiabinfeng/Documents/work/go/q9jy-backend/.claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
  --cd "/Users/jiabinfeng/Documents/work/go/q9jy-backend" \
  --SESSION_ID "uuid-from-response" \
  --PROMPT "Write unit tests for that"
```

## Common Patterns

**Code Review (request unified diff):**
```bash
python /Users/jiabinfeng/Documents/work/go/q9jy-backend/.claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
  --cd "/Users/jiabinfeng/Documents/work/go/q9jy-backend" \
  --PROMPT "Review backend/internal/service/order.go and provide unified diff for improvements. OUTPUT: Unified Diff Patch ONLY."
```

**Debug with full trace:**
```bash
python /Users/jiabinfeng/Documents/work/go/q9jy-backend/.claude/skills/collaborating-with-codex/scripts/codex_bridge.py \
  --cd "/Users/jiabinfeng/Documents/work/go/q9jy-backend" \
  --PROMPT "Debug this error: ..." \
  --return-all-messages
```

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/jiabinone) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-14 -->

