Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(codex): rewrite CLAUDE.md → AGENTS.md in generated Codex skills#1996

Open
ashcharus-hue wants to merge 1 commit into
garrytan:main from
ashcharus-hue:fix-codex-claude-md-to-agents-md
Open

fix(codex): rewrite CLAUDE.md → AGENTS.md in generated Codex skills #1996
ashcharus-hue wants to merge 1 commit into
garrytan:main from
ashcharus-hue:fix-codex-claude-md-to-agents-md

Conversation

@ashcharus-hue

@ashcharus-hue ashcharus-hue commented Jun 13, 2026

Copy link
Copy Markdown

Problem

Codex uses AGENTS.md as its project instruction file (OpenAI AGENTS.md guide), but hosts/codex.ts pathRewrites is missing the CLAUDE.mdAGENTS.md rewrite. Every generated Codex-host skill therefore still references CLAUDE.md:

  • The routing preamble runs if [ -f CLAUDE.md ] && grep -q "## Skill routing" CLAUDE.md — a false negative on a Codex project, which uses AGENTS.md.
  • The routing-injection step then offers to create a CLAUDE.md and run git add CLAUDE.md && git commit. In a spawned/headless run (SPAWNED_SESSION), AskUserQuestion is skipped and the recommended option is auto-chosen, so it can auto-create and commit a stray CLAUDE.md into 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 pattern hosts/hermes.ts already uses:

{ from: 'CLAUDE.md', to: 'AGENTS.md' },

The bare CLAUDE.md rewrite matches only the standalone filename; the existing .claude/... path rewrites are unaffected.

Verify

After bun run gen:skill-docs --host codex, generated Codex skills reference AGENTS.md and no longer contain the CLAUDE.md routing-injection path.

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>

trunk-io Bot commented Jun 13, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /