claude-codex-subagent
AGENTS.md4 starsChanged 7 months agoMITView on GitHub
This repository packages a Claude Code skill that teaches Claude to delegate expensive work to local codex exec. The job of every agent in this repo is to keep that delegation workflow accurate, current, and directly runnable. - skills/codex-subagent/SKILL.md is the source of truth for Claude behavior. - scripts/codex-dispatch.sh is the executable reference implementation. - docs/codex-dispatch-guide.md is the detailed parameter and workflow guide for both Claude and Codex. - docs/prompt-and-agent-patterns.md is the public guide for prompt, agent, skill, command, result-handling,…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- codex-subagentSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
16 rules. About 1 is common, 4 are distinctive, and 11 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Prefer --sandbox workspace-write for normal local repo work.
- Very specific: line 23
Do not introduce new --full-auto examples.
- Very specific: line 26
Use --dangerously-bypass-approvals-and-sandbox only for tasks that truly need shell network, cross-workspace access, global installs, or as …
- Very specific: line 29
Use helper --search for current public web facts when shell network is not needed.
- Very specific: line 31
Use --json, -o/--output-last-message, and --output-schema when the result is consumed by automation.
- Very specific: line 33
Keep --skip-git-repo-check in all codex exec examples and wrappers.
- Very specific: line 34
Treat resume as a separate parameter surface: --cd, --profile, --add-dir, and non-bypass --sandbox are fresh-session context flags and …
- Distinctive: line 42
Keep the project zero-dependency: markdown plus bash only.
- Very specific: line 43
If you change Codex flags or sandbox rules, update all of these together: skills/codex-subagent/SKILL.md, scripts/codex-dispatch.sh, …
- Very specific: line 47
If you add or change a persona, ensure it has YAML frontmatter, a {{TASK}} placeholder, and an explicit return format.
- Very specific: line 49
If you change durable prompt, agent, skill, command, or publication guidance, update docs/prompt-and-agent-patterns.md and keep private …
- Common: line 52
Do not add generated artifacts, logs, transcripts, credentials, or real local session data to the repo.
- Very specific: line 54
Use UTF-8 and LF line endings.
- Distinctive: line 58
Run these before handing off changes:
- Distinctive: line 73
When reading Markdown or other UTF-8 text through Windows PowerShell, force UTF-8 output so Chinese examples and box drawing characters do …
- Distinctive: line 84
When leaving a substantial change for the next agent, include:
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
claude-codex-subagent Agent Rules
This repository packages a Claude Code skill that teaches Claude to delegate
expensive work to local codex exec. The job of every agent in this repo is to
keep that delegation workflow accurate, current, and directly runnable.
Repository Role
skills/codex-subagent/SKILL.mdis the source of truth for Claude behavior.scripts/codex-dispatch.shis the executable reference implementation.docs/codex-dispatch-guide.mdis the detailed parameter and workflow guide for both Claude and Codex.docs/prompt-and-agent-patterns.mdis the public guide for prompt, agent, skill, command, result-handling, and publication patterns.personas/*.mdare prompt templates. Their frontmatter must stay simple:persona,sandbox,effort, andwhen-to-use.
Codex CLI Baseline
Target Codex CLI 0.141.0 or newer.
- Prefer
--sandbox workspace-writefor normal local repo work. - Do not introduce new
--full-autoexamples. It is a deprecated compatibility alias; scripts may acceptfull-autoas a user-facing alias only if they emit--sandbox workspace-write. - Use
--dangerously-bypass-approvals-and-sandboxonly for tasks that truly need shell network, cross-workspace access, global installs, or as a documented Windows sandbox fallback. - Use helper
--searchfor current public web facts when shell network is not needed; directcodex execuses--config web_search="live". - Use
--json,-o/--output-last-message, and--output-schemawhen the result is consumed by automation. - Keep
--skip-git-repo-checkin allcodex execexamples and wrappers. - Treat resume as a separate parameter surface:
--cd,--profile,--add-dir, and non-bypass--sandboxare fresh-session context flags and should be rejected by the helper on--resume;--model,--config,--json,-o,--output-schema,--ephemeral, and explicit bypass are resume-time controls in Codex CLI 0.141.0.
Editing Rules
- Keep the project zero-dependency: markdown plus bash only.
- If you change Codex flags or sandbox rules, update all of these together:
skills/codex-subagent/SKILL.md,scripts/codex-dispatch.sh,scripts/doctor.sh,docs/codex-dispatch-guide.md,README.md,INSTALL.md, andexamples/sample-dispatches.md. - If you add or change a persona, ensure it has YAML frontmatter, a
{{TASK}}placeholder, and an explicit return format. - If you change durable prompt, agent, skill, command, or publication guidance,
update
docs/prompt-and-agent-patterns.mdand keep private local details out of public examples. - Do not add generated artifacts, logs, transcripts, credentials, or real local session data to the repo.
- Use UTF-8 and LF line endings.
.gitattributesenforces LF.
Validation
Run these before handing off changes:
bash scripts/doctor.sh
bash scripts/test-dispatch-wrapper.sh
bash scripts/codex-dispatch.sh --debug 'Return exactly: OK'
bash scripts/codex-dispatch.sh --sandbox workspace-write 'Return exactly: OK'
git diff --check
git status --shortOn Windows PowerShell, run these through Git Bash if plain bash is not on
PATH. Prefer codex.cmd and claude.cmd over .ps1 shims when execution
policy blocks scripts.
When reading Markdown or other UTF-8 text through Windows PowerShell, force UTF-8 output so Chinese examples and box drawing characters do not turn into mojibake:
[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new($false)
Get-Content -Raw -Encoding UTF8 README.mdHandoff Standard
When leaving a substantial change for the next agent, include:
- current branch and dirty state,
- files changed,
- exact validation commands and outcomes,
- any Codex CLI version assumptions,
- known Windows sandbox caveats,
- next recommended command.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

