agentleFS
fredchufredchu/claude-codex-dispatch/SKILL.md

codex-dispatch

Skill1 starsChanged 5 months agoMITView on GitHub

Dispatch OpenAI Codex CLI directly from Claude Code with a structured role contract. Use when Claude Code needs Codex to act as worker, verifier, reviewer, or synthesizer through codex exec, with write-scope checks, run artifacts, and structured result output. Always uses Codex CLI directly, not a Claude subagent wrapper.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill to call OpenAI Codex CLI directly from Claude Code while preserving the orchestrator's role boundaries and verification …

    line 20
  2. Distinctive:

    All dispatches must go through:

    line 25
  3. Distinctive:

    Create a task packet Markdown file.

    line 56
  4. Very specific:

    After a run, read result.md and policy.json.

    line 130
  5. Very specific:

    If policy.json reports policy_violation: true, stop and surface that before continuing.

    line 133

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Codex Dispatch

Use this skill to call OpenAI Codex CLI directly from Claude Code while preserving the orchestrator's role boundaries and verification discipline.

Core Rule

All dispatches must go through:

python3 ~/.claude/skills/codex-dispatch/scripts/codex_dispatch_role.py --task <task-file>

The script always calls codex exec with:

--dangerously-bypass-approvals-and-sandbox

Safety therefore comes from the task packet, wrapper checks, git status snapshots, write-scope validation, and orchestrator review of the result artifacts.

Modes

Pick exactly one mode per dispatch:

ModeUse forWrites
workerbounded implementation, small refactor, deterministic patchallowed only inside WRITE SCOPE
verifierprove or disprove a claim with fresh evidenceforbidden
reviewerreview a diff, plan, or implementationforbidden
synthesizermerge conflicting findings or agent outputsforbidden

Verifier, reviewer, and synthesizer modes are read-only by contract. The wrapper will report a policy violation if the working tree changes.

Task Packet

Create a task packet Markdown file. Use this minimum shape:

MODE: verifier
WORKDIR: /path/to/your/project
OBJECTIVE: Verify that the targeted test and build checks work.

WRITE SCOPE:
- none

NON-GOALS:
- Do not modify files.
- Do not install packages.

VERIFICATION:
- pytest tests/ -v
- pytest tests/ -k "specific_test" -v

DELIVERABLE:
- Return whether the claim is supported and cite command evidence.

For full field guidance, read references/task-packet.md.

Worker laziness (LAZY)

worker dispatches inject a "lazy senior dev" constraint by default: a YAGNI / stdlib-first / minimal-diff ladder that biases Codex toward smaller, self-verifying patches. It appears verbatim in the generated prompt.md, so it is auditable. Disable per-dispatch with LAZY: off. Read-only modes (verifier, reviewer, synthesizer) never receive it, since its code-first terseness would be noise there. Grounded in the ponytail A/B (2026-06-15): the ladder cut worker implementation logic ~38% and forced a runnable check the orchestrator can rerun for command-tier evidence.

Run

python3 ~/.claude/skills/codex-dispatch/scripts/codex_dispatch_role.py \
  --task /path/to/task.md

Useful options:

--dry-run                 # build prompt and artifacts without calling Codex
--output-dir <dir>        # default: <workdir>/.codex-dispatch/runs
--allow-dirty-overlap     # allow worker mode to touch already-dirty scoped files
--stall-retries <n>       # fresh retries on a zero-stdout stream stall (default 2)

Intermittent Codex stream stalls kill a run before any stdout (empty events.jsonl); the wrapper auto-retries that exact signature up to --stall-retries times (stall_retries_used lands in policy.json). Real output followed by a stall, or a non-zero exit, is not retried.

The script writes:

.codex-dispatch/runs/<run-id>/
├── task.md
├── prompt.md
├── events.jsonl
├── result.json
├── result.md
├── pre-status.txt
├── post-status.txt
├── pre-diff-stat.txt
├── post-diff-stat.txt
└── policy.json

Completion

After a run, read result.md and policy.json. For worker mode, also inspect the git diff. Do not accept Codex's own success claim without fresh evidence.

If policy.json reports policy_violation: true, stop and surface that before continuing.

Evidence tiers (採信順序 ci > command > manual)

Rank Codex's completion claim by how it was produced, not by what it asserts:

  • manual — Codex self-reports "tests pass" / "done" in result.md. Records intent only; never accept as passing.
  • command — the orchestrator (not Codex) reruns the verification command and sees exit 0 + real output. This is the minimum bar to accept a worker result.
  • ci — external CI / GitHub Actions artifact. Highest trust.

Rule: a worker completion may not be accepted below command tier.

Fingerprint-disabled = evidence downgrade

policy.json skips the working-tree fingerprint check when dirty_file_count_before exceeds the limit (200), reporting fingerprint_enabled: false / Fingerprint check skipped. In a chronically-dirty repo (e.g. For_Claude ~1850 dirty) this layer is silently off, so out-of-scope edits to already-dirty files are not caught. Treat fingerprint_enabled: false as a downgrade signal: the manual git-diff review is now mandatory, not optional. For important worker write scopes, consider dispatching in a clean worktree — see /Users/fredchu/Documents/For_Claude/company/_shared/references/cx-worktree-worker-dispatch-runbook-2026-06-14.md.

References

  • Task packet format: references/task-packet.md
  • Mode policy: references/mode-policy.md
  • Orchestrator integration notes: references/orchestrator-integration.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.