Skillquality 0.51

collaborating-with-codex

Delegate tasks to Codex CLI for prototyping, debugging, code review, and implementation. Supports multi-turn sessions via SESSION_ID.

Price
free
Protocol
skill
Verified
no

What it does

Collaborating with Codex

Use Codex CLI as a collaborator while your primary agent remains the implementer.

The bridge script (scripts/codex_bridge.py) wraps codex exec (headless mode), returns structured JSON, and manages session continuity via SESSION_ID.

Safety

Codex runs in a sandbox by default. The bridge defaults to read-only:

  • --sandbox read-only(default) no file writes, no destructive commands. Recommended for review/consultation.
  • --sandbox workspace-write — can write files in the workspace only.
  • --sandbox danger-full-access — unrestricted. Use only in externally sandboxed environments.
  • --full-auto — convenience alias for sandboxed auto-execution (workspace-write + auto-approve).

Do not use --full-auto or danger-full-access unless you understand the implications.

When to use

  • Algorithm implementation, bug analysis, or code generation.
  • Code review or adversarial review.
  • Second opinion on architecture, edge cases, or test gaps.
  • Research or diagnosis with tool use.

When not to use

  • Trivial tasks your primary agent can handle directly.
  • Anything involving secrets, private keys, or prod data.

Quick start

⚠️ Backticks in prompts trigger shell command substitution — use a heredoc. See references/shell-quoting.md.

PROMPT="$(cat <<'EOF'
Review src/auth.py around login() and propose fixes.
OUTPUT: Unified Diff Patch ONLY.
EOF
)"
python3 skills/collaborating-with-codex/scripts/codex_bridge.py \
  --cd "." --PROMPT "$PROMPT"

Returns: { "success": true, "SESSION_ID": "...", "agent_messages": "..." }

Multi-turn sessions

Capture SESSION_ID from the first call and pass it back:

# Turn 1
python3 skills/collaborating-with-codex/scripts/codex_bridge.py \
  --cd "." --PROMPT "Analyze the bug in foo()."

# Turn 2 — resume by ID
python3 skills/collaborating-with-codex/scripts/codex_bridge.py \
  --cd "." --SESSION_ID "<id>" --PROMPT "Propose a fix."

# Or resume the most recent session
python3 skills/collaborating-with-codex/scripts/codex_bridge.py \
  --cd "." --last --PROMPT "What about edge cases?"

Bridge flags

FlagPurposeDefault
--PROMPTPrompt text (required)
--cdWorkspace root (required)
--SESSION_IDResume a previous session by thread IDnew session
--lastResume the most recent sessionoff
--modelOverride Codex modelCLI default
--sandboxread-only · workspace-write · danger-full-accessread-only
--full-autoSandboxed auto-executionoff
--imageAttach image files (repeatable)none
--add-dirAdditional writable directories (repeatable)none
--skip-git-repo-checkAllow running outside a Git repooff
--ephemeralDon't persist session to diskoff
--return-all-messagesInclude all JSONL events in outputoff

Default timeout: set timeout_ms to 600000 (10 min) when invoking via an external command runner.

Prompting patterns

Use assets/prompt-template.md for quick plain-text starters. For complex tasks, use composable XML prompt blocks — see references/prompt-blocks.md.

Key principles:

  • Point, don't paste — give file paths and line numbers, not code blocks.
  • One objective per prompt — multiple competing goals produce noisy output.
  • State what done looks like — Codex works best with explicit acceptance criteria.
  • Use prompt blocks — wrap objectives in <task>, add <verification_loop> for correctness, <grounding_rules> for reviews.
  • Enforce output format — append OUTPUT: Unified Diff Patch ONLY. for code changes when using read-only sandbox.

Verification

  • Smoke test: python3 skills/collaborating-with-codex/scripts/codex_bridge.py --help
  • Session test: run one prompt, confirm JSON contains success: true and a SESSION_ID.

Collaboration State Capsule

Keep this block updated while collaborating:

[Codex Capsule] Goal: | SID: | Sandbox: | Files: | Last: | Next:

References

Capabilities

skillsource-appautomatonskill-collaborating-with-codextopic-agent-skillstopic-agentic-workflowstopic-ai-agentstopic-ai-coding-assistanttopic-claude-codetopic-claude-skillstopic-codextopic-gemini-clitopic-mcp

Install

Quality

0.51/ 1.00

deterministic score 0.51 from registry signals: · indexed on github topic:agent-skills · 113 github stars · SKILL.md body (4,515 chars)

Provenance

Indexed fromgithub
Enriched2026-05-18 18:56:19Z · deterministic:skill-github:v1 · v1
First seen2026-05-06
Last seen2026-05-18

Agent access