-
Notifications
You must be signed in to change notification settings - Fork 16.3k
fix(codex): rewrite CLAUDE.md → AGENTS.md in generated Codex skills#1996
Open
ashcharus-hue wants to merge 1 commit into
Open
fix(codex): rewrite CLAUDE.md → AGENTS.md in generated Codex skills #1996ashcharus-hue wants to merge 1 commit into
ashcharus-hue wants to merge 1 commit into
Conversation
Codex uses AGENTS.md as its project instruction file, but the codex host config's pathRewrites omit the CLAUDE.md -> AGENTS.md rewrite that hosts/hermes.ts already has. Generated Codex-host skills therefore still reference CLAUDE.md: the routing preamble checks `[ -f CLAUDE.md ]`, and the routing-injection step can create and `git commit` a CLAUDE.md in a Codex repo (auto-applied in spawned/headless runs). Mirrors the hermes.ts pattern. Refs garrytan#1163. Complements garrytan#1162 (Codex model/tool rewrites, which did not include this filename rewrite). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Merging to main in this repository is managed by Trunk.
- To merge this pull request, check the box to the left or comment
/trunk mergebelow.
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here
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.
Problem
Codex uses
AGENTS.mdas its project instruction file (OpenAI AGENTS.md guide), buthosts/codex.tspathRewritesis missing theCLAUDE.md→AGENTS.mdrewrite. Every generated Codex-host skill therefore still referencesCLAUDE.md:if [ -f CLAUDE.md ] && grep -q "## Skill routing" CLAUDE.md— a false negative on a Codex project, which usesAGENTS.md.CLAUDE.mdand rungit add CLAUDE.md && git commit. In a spawned/headless run (SPAWNED_SESSION),AskUserQuestionis skipped and the recommended option is auto-chosen, so it can auto-create and commit a strayCLAUDE.mdinto a Codex repo.This matches #1163 (Codex-generated skills carry Claude defaults). #1162 added Codex model/tool rewrites but not this filename rewrite.
Fix
Add the rewrite to
hosts/codex.ts, mirroring the patternhosts/hermes.tsalready uses:The bare
CLAUDE.mdrewrite matches only the standalone filename; the existing.claude/...path rewrites are unaffected.Verify
After
bun run gen:skill-docs --host codex, generated Codex skills referenceAGENTS.mdand no longer contain theCLAUDE.mdrouting-injection path.