openai / openai/codex

Claude Code skill import rewrites `.claude/` paths to `.Codex/`, producing directories that don't exist

Open
#40,147 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug skills
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Summary

The external-agent import that copies Claude Code skills into ~/.agents/skills/
substitutes the token claudeCodex across the entire file body, including
inside literal filesystem paths. Prose retargeting is correct and useful; path
rewriting is not, because it produces paths that do not exist.

Repro

  1. Have a Claude Code skill at ~/.claude/skills/example/SKILL.md whose body
    references a real path, e.g.:

    Session transcripts live in ~/.claude/projects/<slug>/
    See also .claude/commands/example.md
    
  2. Let the Codex desktop onboarding import run ([desktop] external-agent-import-sync-enabled = true).

  3. Read the imported copy at ~/.agents/skills/example/SKILL.md.

Actual

Session transcripts live in ~/.Codex/projects/<slug>/
See also .Codex/commands/example.md

Expected

The path should be left as ~/.claude/projects/<slug>/. It is an absolute
reference to a real directory owned by another tool, not an agent-relative path
that has a Codex equivalent.

Why this breaks

Two separate problems:

  1. Wrong case. Codex is the display name; the directory is .codex. On
    case-insensitive APFS this happens to resolve, so it is silent on macOS and
    would break on a case-sensitive volume or on Linux.

  2. No such directory — the real problem. Codex has no analogue for most of
    these. On my machine, after import:

    rewritten to exists?
    ~/.codex/commands/ no
    ~/.codex/projects/ no
    ~/.codex/handoffs/ no
    ~/.codex/plans/ no
    ~/.codex/skills/ yes (coincidence — same directory name)

    So every imported skill that cites a ~/.claude/<subdir>/ path now sends the
    agent to a directory that does not exist. In my case that was 10 references
    across 5 imported skills.

The prose substitutions in the same pass are correct and worth keeping —
CLAUDE.mdAGENTS.md, "Claude Code UI" → "Codex UI". It is specifically the
path-shaped occurrences that should be exempt.

Suggested fix

Skip substitution for occurrences that look like filesystem paths — a match
preceded by /, ~/, or $HOME/, or immediately followed by /. A skill that
names another tool's data directory means that directory literally.

Failing that, at minimum substitute .claude.codex rather than .Codex,
so the result is not also case-wrong.

Environment

  • Codex CLI v0.149.0-alpha.4.1 (ChatGPT desktop, macOS)
  • macOS 15 / Darwin 25.5.0, APFS (case-insensitive)
  • Relevant module per binary strings: codex_tui::external_agent_config_migration

Workaround

Set external-agent-import-sync-enabled = false under [desktop] in
~/.codex/config.toml after the initial import, and repair the imported paths by
hand. The import is one-shot, so repairs survive normal codex exec use.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at codex_tui::external_agent_config_migration and reproduce the desktop external-agent import with a skill containing ~/.claude/projects/ and .claude/commands/ paths. Add or update regression coverage so path-shaped references remain literal while prose substitutions still occur, then verify the imported output.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.