codex-in-claude CLAUDE.md

codex-in-claude CLAUDE.md is an instructions file for coding agents from ytubecoder/codex-in-claude. It costs 2,188 tokens per session, scanned A, original, MIT.

A set of instructions for using external command-line agents to review plans and delegate implementation work in the codex-in-claude project.

In plain words
What is it for?
Use it when reviewing a plan with Codex, Grok, or Gemini, delegating work to isolated peon agents, or keeping installed copies of these workflows synchronized.
Why use it?
It defines rules for independent, read-only plan reviews and for sending implementation tasks to isolated workspaces, reducing review conflicts and accidental changes.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/ytubecoder/codex-in-claude/claude-md
Clone the repo
git clone --depth 1 https://github.com/ytubecoder/codex-in-claude

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for codex-in-claude CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ytubecoder/codex-in-claude/claude-md.svg)](https://agentmods.dev/instructions/ytubecoder/codex-in-claude/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/ytubecoder/codex-in-claude/claude-md"><img src="https://agentmods.dev/badge/instructions/ytubecoder/codex-in-claude/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,188 This file is loaded in full into every session.
When invoked 2,188 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02188 $0.02188
Opus 5 $0.01094 $0.01094
Sonnet 5 $0.00438 $0.00438
Haiku 4.5 $0.00219 $0.00219

Measured 3d ago against content hash 7e8f0cbd4050, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

codex-in-claude CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 46 lines

How it starts

The opening of the file, as written. The whole thing — 46 lines — stays where its author put it; the contents beside it link to each section on GitHub.

codex-in-claude

Two Claude Code skills backed by external CLI agents (Codex, Grok, Gemini via gemini-cli or Antigravity/agy), plus the bin/peon script:

  • skills/plan-check/SKILL.md — mediated plan review (opinions in). Read-only reviewers.
  • skills/peon-poke/SKILL.md — farm implementation work out to worktree-isolated peons (labor out). bin/peon is the deterministic interface; the skill teaches workflow only.

This repo is the source of truth. Installed copies on this machine live in ~/.claude/skills/{plan-check,peon-poke}/ (that dir is its own git repo, no remote) and ~/.local/bin/peon — re-sync installed copies after editing here.

Invariants — plan-check

  • Reviewers are independent: identical round-1 prompts; no reviewer sees another's output except a Claude-authored relay on a direct contradiction (escalation only).
  • Plan content travels inside the prompt — reviewers work without repo access, read-only sandboxes.
  • The skill never edits plan files.
  • codex exec resume has NO -s flag — sandbox for resumed sessions goes via -c sandbox_mode=... (broke live 2026-07-29 on codex-cli 0.145.0).
  • Gemini reviews run --approval-mode plan (read-only policy mode) from a dedicated mktemp -d dir: gemini sessions are per-directory and resumed by recency only, so the private dir is what makes --resume latest unambiguous across rounds.
  • Antigravity (agy) reviews run --mode plan --output-format json; capture conversation_id from the JSON for rounds 2+ (--conversation <id>). Never seat both gemini and agy in one council — same model family, no independence.
  • gemini-cli stopped serving consumer Google accounts (free/AI Pro/Ultra) on 2026-06-18 — "gemini" requests route to agy unless the machine has an enterprise/API-key gemini setup.

Invariants — peon-poke

  • Hub-and-spoke: all work products return to the orchestrator; peons never share state.
  • Draft-until-reviewed: peon output stays on peon/<slug> branches in $PEON_HOME/worktrees/; only explicit peon merge (after review) lands it. Every merge gets exactly one review treatment — full-diff read (classic), the complete black-box gate set per docs/BLACKBOX-ACCEPTANCE.md (peon check + test audit + independent probes), or spot review (self-tested brief + foreman-run verify via check + diffstat + load-bearing hunks only) — never none.
  • Evidence hierarchy: everything the peon writes (report prose, pasted test output) is generator-class self-reporting, advisory only; gates are computed foreman-side from git facts + foreman-run commands. Never chase a peon-reported test failure before reproducing via peon check (forced-color env leakage alone has faked failures, live 2026-08-02).
  • Exit codes: 1 = usage/environment/provider error; 3 = peon contract violation, worktree + metadata preserved. The session id persists to meta BEFORE the contract gate, so poke/adopt still work after a tripped dispatch.
  • peon adopt <slug> is the sanctioned recovery for sandbox-blocked commits (work + PEON_REPORT.md on disk, uncommitted, exit 3): foreman-commits the lot on the peon branch. Refuses a clean worktree or missing report. Adoption is mechanics, NOT acceptance — review still decides the merge. Never hand-roll git add/commit in a peon worktree.
  • Color-forcing env vars (CLICOLOR_FORCE, FORCE_COLOR, CLICOLOR) are unset at the top of bin/peon — Claude Code's Bash tool exports CLICOLOR_FORCE=1, which leaks forced ANSI into peon test runs and the verify gate, faking failures in text-matching helpers.
  • Merge subject truncation is char-safe via python — bash printf '%.60s' counts bytes and cut a multibyte char mid-sequence (invalid UTF-8 merge subject, live 2026-08-02).
  • peon check --allow/--verify overrides: one-off when a contract was recorded at dispatch; late-DECLARE the contract (persisted to meta, merge-enforced) when none was — otherwise a check-time verify would never bind the merge.
  • Acceptance contract in meta: --allow (file-scope globs, fnmatch, * crosses /) and --verify (command) recorded at dispatch. peon check executes them foreman-side and records the verify result against the branch tip sha; peon merge refuses out-of-scope files and failed/stale/never-run verify (--unchecked bypasses with a loud warning). Peon-pasted test output is advisory only — the foreman-run verify is the gate.
  • peon report usage line is parsed from logs already on disk (codex JSONL: cumulative totals, counter-drop = run boundary, run finals summed; agy: last usage dict per JSON doc, summed; grok/gemini: no counts → n/a). Self-reported, approximate, observability only — NEVER add a "savings" estimate: the counterfactual never ran and a fabricated metric would nudge farming-out of tasks where the method is net-negative.
  • Metadata is OUT of the worktree: $PEON_HOME/meta/<slug>.json, atomically reserved (noclobber) — slugs are global identities. Nothing peon-related is ever written into the user's repo or worktree by the harness.
  • Contract gates after every provider run: commits since gate ref (dispatch: base; poke: pre-poke HEAD) + committed PEON_REPORT.md + clean worktree. Violations fail loudly and preserve the worktree.
  • bin/peon is the only interface — skills and agents never hand-roll worktree or provider incantations. bash-3.2-compatible; deps: git, python3, uuidgen. Never jq, never codex exec resume --last.
  • Grok headless can only COMMIT with --always-approve (GROK_APPROVE=always, the live-locked default); --permission-mode auto/dontAsk permit file edits but block git-commit shell calls — the peon then trips the contract gate having "succeeded". AND: in linked worktrees grok's sandbox cannot write the main repo's .git/worktrees/ gitdir at all (observed 3× live 2026-08-02, loops repo), so even --always-approve grok exits 3 with work + report on disk — the healthy grok path is dispatch → exit 3 → review → peon adopt → merge, with each poke round repeating exit 3 → adopt. The dispatch prompt carries the no-escape rule (never improvise remotes/.git dirs around a blocked commit).
  • Gemini peons run --approval-mode yolo with NO -s/--sandbox: a linked worktree's git dir lives under the main repo's .git/worktrees/, outside gemini's seatbelt project boundary, so a sandboxed peon could edit but never commit (grok-approve-class trap). Containment is the worktree + review. ⚠ Flag-semantics reasoning only (gemini-cli 0.53.0) — NOT live-verifiable on consumer accounts since the 2026-06-18 cutoff; verify before trusting on an enterprise setup.
  • Gemini has no id-addressed resume: per-directory session store, poke runs --resume latest from the worktree cwd. Invariant: nothing but the harness ever runs gemini inside a peon worktree.
  • agy (Antigravity) peons run --dangerously-skip-permissions --output-format json --print-timeout 30m, NO --sandbox (same worktree-git-dir reasoning as gemini). conversation_id is extracted fail-closed from the JSON (missing id or status != SUCCESS dies); poke resumes with --conversation <id>. The 30m print-timeout matters — agy's default is 5m, which would kill real dispatches mid-task. LIVE-LOCKED 2026-07-30 (agy 1.1.8): skip-permissions commits work; contract gate passes; resume keeps context.
  • agy can MINT A NEW conversation_id on resume (observed live 2026-07-30 — context carries over but the id rotates). The log accumulates one JSON doc per run; extract_agy_conversation reads the LAST doc, and cmd_poke persists the new head to meta before the contract gate. Never resume an older id from the chain — later pokes' context silently vanishes.
  • merge strips PEON_REPORT.md only when the merge target didn't already track it (review artifact, not product code).
  • Tests: bash tests/peon.test.sh (fake provider + dry-run, deterministic, no provider CLIs needed). Run after any bin/peon change.

Read the full file on GitHub · 46 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 46 lines · 2,188 tokens per session scan A 7e8f0cbd4050

Subscribe to this mod's changes

codex-in-claude CLAUDE.md is an instructions file published in the GitHub repository ytubecoder/codex-in-claude (2 stars, last pushed 1mo ago), licensed MIT. It adds 2,188 tokens to every session, about $0.0109 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.