Repository navigation
feat(agents): bridge the skills and CLAUDE.md to Codex, and say what cannot be bridged - #822
Merged
Merged
Conversation
Codex reads `.agents/skills/` and `AGENTS.md`, and reads NEITHER `.claude/skills/` nor `CLAUDE.md` — `CLAUDE.md` does not occur in the 0.167.0 binary at all. The skills bridge was already here; the instructions were not, so a Codex session (Kimi K3 included — the same binary under `--profile kimi`) started with 25KB of project conventions it could not see. `AGENTS.md` is now a symlink to `CLAUDE.md`, and the bridge gate covers both sides. Claude Code discovers `AGENTS.md` too, so the obvious hazard is loading the instructions twice; probed, and it does not — one path listed, body once. The gate is renamed `agent-bridge-check` because it is no longer only about skills. It refuses a missing bridge in either direction, a dangling link, a link that resolves elsewhere, a bridge forked into a real copy, and an INVERTED instruction bridge — every reference in the repo names `CLAUDE.md`, so making that one the symlink leaves the authored file as the one nothing points at. It is now in `make check` as well as ungated in rust.yml's `skills` job: the way this breaks is `mkdir`ing a skill and forgetting the other side, and finding that out from a red required check after the push is the whole failure it exists to make local. The MCP servers cannot be bridged, and that is measured rather than assumed. A project-level `.codex/config.toml` IS merged into the session — a `sandbox_mode` set there takes effect — but its `mcp_servers` table is ignored: a working stdio MCP server declared in the project file is absent from the session, and the identical server injected with `-c` is present. So `scripts/codex-mcp-sync.sh` derives `codex mcp add` from `.mcp.json` instead, which is what keeps `--read-only` and `--profile er-readonly` from going missing in a retyped invocation. Its suite forces every refusal, because a sync that passes over a server quietly reads as "synced" with the tool absent. Hooks and `permissions.deny` have no project-scoped equivalent at all: neither `.codex/hooks.json` nor `.agents/hooks.json` fires from a project directory (only `$CODEX_HOME`'s does — those path strings live in Codex's Claude-Code migration reader, which is what makes them look repo-scoped). So under Codex nothing intercepts an `aws`, `terraform`, `kubectl` or `helm` write. Recorded in the agent-skills standard with the probe behind each claim, and owned by #826. Found on the way, and fixed here because it is the same defect class: a ` #` in a `description` ends the YAML scalar, silently. `project-board` carried `project #2` and was being selected on 117 of its 989 characters — every trigger phrase and all four routing clauses were in the discarded part, in Claude Code as much as in Codex. The gate could not see it because `frontmatter_value` reads the raw line, which is also why the description-budget table reported the full 991. Reworded, with `desc_truncated_by_yaml_comment` added to the lint and driven from both sides so it cannot return. Codex also truncates every description at ~670 characters, cutting exactly the routing tails this repo's skill standard relies on; 27 of 28 are over it. That one needs a measurement before 27 descriptions are rewritten, so it is #825. Closes #823 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #823
What
Makes this repo's agent configuration readable by Codex — Kimi K3 included,
since that is the same
codexbinary under--profile kimi. The 28 skills andCLAUDE.mdare still authored once and bridged by symlink(
.agents/skills/<name>,AGENTS.md), withagent-bridge-checkfailing amissing or forked bridge in either direction. The one piece no symlink can carry
— the MCP servers — gets
scripts/codex-mcp-sync.sh, which derivescodex mcp addfrom.mcp.json. Three.claude/settings.jsonpieces have norepo-scoped equivalent at all and are now recorded as such rather than assumed.
Why
Codex reads
.agents/skills/andAGENTS.md, and reads neither.claude/skills/norCLAUDE.md— probed, not inferred:CLAUDE.mdappearsnowhere in the 0.167.0 binary. A second agent on this clone therefore started
with no project instructions and no project skills. The failure is silent in
whichever tool nobody is looking at, which is why the bridge is a gate rather
than a paragraph — and why it runs ungated, since a skills-only pull request is
exactly the shape
detectskips.Proof
make checkgreen, including the newagent-bridge-checktarget. Both gateswere then observed failing on the real tree before being trusted:
End state measured from Codex's side with
codex debug prompt-input, whichrenders exactly what the model was given: skill root
r2 = <repo>/.agents/skillswith all 28 skills listed, and anagents_md.instructionsblock carryingCLAUDE.mdthrough the symlink.codex mcp listshows theawsserver with--read-onlyand--profile er-readonlyintact.Suites:
agent-bridge-check-test.sh15 cases,codex-mcp-sync-test.sh15,detect-paths-test.sh39,skills-check-test.sh16 — each mutation-tested, seeContext.
Risk & rollback
Risk is confined to the gate: a false failure blocks pull requests on a symlink
rather than on code. It is pure bash over the checked-out tree with no network
and no toolchain, and the two symlink sets it reads are the only thing it
touches.
scripts/codex-mcp-sync.shwrites to$CODEX_HOME, never to the repo,and is never run by CI.
Rollback:
git revert <merge-sha>. The.agents/symlinks andAGENTS.mdrevert with it; a developer who has already run
codex-mcp-sync.shundoes itwith
codex mcp remove aws.Post-merge ledger
Closed by: agent · session
c19a9a1f-4446-4d2f-bd7d-5ac2d0f08ecaonbrians-MacBook-Pro· 2026-11-08T00:18:00Zmainis green with this change on it — merge SHA89e4df96,rustpush run 42428830430:
23 jobs, 250 steps, 19 success / 0 failure (4 skipped). The step count is
there deliberately — a starved or cancelled run sums to 0 steps, and that
is what distinguishes this from the zero-job green.
frontend,infraand
devcontaineralso succeeded on the same SHA. The three new stepsran:
agent config bridge symlinks (Codex discovery),agent-bridge regression tests,codex-mcp-sync derivation tests.images—n/a — correctly never ran.scripts/ci/images-detect.shkeys on the
^rust/and^frontend/trees plusimages.ymlitself; thismerge touched
.agents/,.claude/,AGENTS.md,CLAUDE.md,Makefile,scripts/andrust.ymland none of those.gh run list --commit 89e4df96 --workflow images.ymlreturns[]— the workflow did nottrigger at all, rather than running and skipping.
deploy—n/a — nothing to deploy.deployfires onworkflow_runafter
images, which did not run, so no deploy run exists on89e4df96.Nothing in this change reaches a container: no Rust source, no frontend
source, no entity, no chart, no Terraform.
driftscheduled run 2026-11-07T06:01 success,kindscheduled run2026-11-07T06:44 success. One thing there is red and is not this
change: the
push-triggereddeployon70f31c54at 2026-11-07T21:37,~2h37m before this merge, which is the known
deploy.ymlpush-triggerdefect — deploy.yml's push trigger was a misdiagnosis — remove it and gate what it was protecting #661 and deploy.yml: a mixed infra/k8s + image-input commit always produces one spurious red deploy #817.
Donethrough the automation: Make the repo work with Codex: bridge the skills and CLAUDE.md, and say what cannot be bridged #823 readsCLOSED / COMPLETED, its card readsDone, and theClosedEvent'scloser.__typenameisPullRequest— so the merge closed it, not ahand edit to
Status(which would have attributed the close toProjectV2).descriptionat ~670 chars, so the routing tails do not exist there — itasks for the Codex-side selection to be measured before 27 descriptions
are rewritten) and No PreToolUse guard under Codex: aws-write-guard and permissions.deny do not port #826 (no
PreToolUseguard and no per-command denylist under Codex, so
aws/terraform/kubectl/helmwrites areunguarded on that path). Both were filed before the merge, carry
ci-backlog, and are on the board asTodo."The Codex bridge" section carrying the probe command
(
codex debug prompt-input) and a table of what does not port with themeasurement behind each row;
CLAUDE.mdgained the short version thatCodex itself now reads; the add-a-skill checklist gained the symlink step.
Two memories were written:
codex-agent-config-bridge(Kimi is the samebinary under
--profile kimi; the hook gap is live and owned by No PreToolUse guard under Codex: aws-write-guard and permissions.deny do not port #826) andprobe-controls-that-prove-nothing(the two probes in this work thatlooked conclusive and were not).
Specific to this change
main, not against thebranch — run from the primary checkout at
89e4df96:codex debug prompt-inputreports rootr2 = <repo>/.agents/skillswith 28 skills listed, and anagents_md.instructionsblock of 27,419 bytes whose first line is# Working in this repo— i.e.CLAUDE.mdarriving through theAGENTS.mdsymlink.project-board's description now reaches Codex at650 characters against 117 before the YAML fix; the remaining cut
is Codex's own ~670 cap, which is Codex truncates skill descriptions at ~670 chars — every routing tail is invisible there #825.
.agents/skillsis still exactly the skill set after the merge:bash scripts/ci/agent-bridge-check.shonmainat89e4df96→agent-bridge: OK (28 skills bridged, AGENTS.md -> CLAUDE.md), exit 0.Context — plan, discoveries, measurements, files
Plan
Bridge the 28 skills to(was already on the.agents/skills/and gate itbranch when this body was written)
BridgeAGENTS.md→CLAUDE.mdand extend the gate to cover itDerive the MCP registration from.mcp.jsoninstead of restating itFix thedescriptionYAML was truncating, and add the lint ruleRecord what does not port, with the probe that establishes each claimmake check, then landDiscoveries
Everything here came from
codex debug prompt-inputor from a two-sided probe;none of it is from documentation.
CLAUDE.mdis invisible to Codex. The string does not occur in the0.167.0 binary.
AGENTS.mddoes, and loads as anagents_md.instructionsitem — through a symlink, which is what makes authoring-once possible.
AGENTS.mdtoo ("Claude Code hardcodes CLAUDE.md /AGENTS.md discovery" is in its binary), so the obvious worry with this bridge
is 25KB of instructions loaded twice. It does not happen: with both present
and one a symlink to the other, Claude Code listed one path and the body
appeared once. Worth stating because the first version of that probe named the
marker string in its own prompt and so counted it twice — the prompt was the
second occurrence.
.codex/config.tomlis merged, but itsmcp_serversisignored. The merge is real:
sandbox_mode = "read-only"set there changedthe session's permissions block. The exception is not. Declaring a working
stdio MCP server in the project file → the tool is absent; the identical
server injected with
-c→ present. The first attempt at this probe used abogus server command and concluded "no error, so it loaded" — Codex
tolerates a failing MCP server silently, so the control said nothing either.
That is the trap this repo already has a memory note for.
$CODEX_HOME, an MCP server does reach a--profile kimisession (asked the Kimi model directly, with a hermetic probe server), so
one sync serves every profile. Kimi's profile turns out to be
$CODEX_HOME/kimi.config.toml, and top-levelconfig.tomlkeys layer underit —
model_reasoning_effort = "max"showed through..codex/hooks.jsonand.agents/hooks.jsonwere both placed with a marker-touchingSessionStarthook; neither fired, only
$CODEX_HOME/hooks.jsondid. Both path strings arein the binary — inside its Claude-Code migration reader, which is what makes
them look repo-scoped. → No PreToolUse guard under Codex: aws-write-guard and permissions.deny do not port #826
descriptionat ~670 characters, word-boundarycut, against this repo's 1,024 cap. 27 of 28 are over it and what gets cut is
the routing tail. → Codex truncates skill descriptions at ~670 chars — every routing tail is invisible there #825
project-board's description was 88% missing, in both tools. It containedproject #2, and YAML ends an unquoted scalar at#— no parse error, nowarning. 117 of 989 characters survived: every trigger phrase and all four
routing clauses were in the discarded part. The gate could not see it because
frontmatter_valuereads the raw line, which is also why thedescription-budget table reported the full 991. Fixed, with
desc_truncated_by_yaml_commentadded to the lint so it cannot return.Measurements
codex debug prompt-inputr2 = <repo>/.agents/skillsagents_md.instructions, via the symlinkproject-boardbefore the fixyaml.safe_loadon its frontmatterproject-boardaftermcp_servershonoured?.codex/config.tomlvs.-c.codex/hooks.jsonand.agents/hooks.json--profile kimi$CODEX_HOME, asked the modelEach suite was mutation-tested rather than trusted for going green. Breaking
codex-mcp-sync.sh's registered-nothing guard turned 15 passes into 14 + 1failure; forwarding only the first argument turned it into 12 + 3, naming
--read-onlyas the lost flag — which is the whole reason that script derivesinstead of restating.
Files
AGENTS.md,.agents/skills/*— the bridges (symlinks)scripts/ci/agent-bridge-check.sh+-test.sh— renamed fromskills-bridge-check*, now covering the instruction bridge tooscripts/codex-mcp-sync.sh,scripts/ci/codex-mcp-sync-test.sh— the MCPderivation and its 15 cases
scripts/skills-check.sh,scripts/ci/skills-check-test.sh— theYAML-comment rule and its discriminating test
scripts/ci/detect-paths.sh+-test.sh—AGENTS.mdexempted, three casesMakefile,.github/workflows/rust.yml— the new target and the two stepsCLAUDE.md,.claude/skills/skill-writer/references/agent-skills.md,.claude/skills/ci-and-supply-chain/SKILL.md— the record.claude/skills/project-board/SKILL.md— the truncated description