codex icon indicating copy to clipboard operation
codex copied to clipboard

/skills lists every skill twice on macOS (Codex CLI v0.73.0) although ~/.codex/skills has no duplicates

Open canyangliunian opened this issue 11 months ago • 8 comments

What version of Codex is running?

Codex CLI v0.73.0

What subscription do you have?

PLUS

Which model were you using?

No response

What platform is your computer?

macOS M1Pro

What issue are you seeing?

/skills output contains duplicated entries, e.g.:

brainstorming appears twice

brand-guidelines appears twice

canvas-design appears twice

changelog-generator appears twice

(…and so on for most/all skills)

What steps can reproduce the bug?

codex

/skills

Image

What is the expected behavior?

Additional information

No response

canyangliunian avatar Dec 17 '25 08:12 canyangliunian

Thanks for the bug report. I'm not able to repro the problem.

Are you sure that you don't have multiple copies of the SKILL.md files in your ~/.codex/skills directory? Codex will scan all subdirectories recursively looking for SKILL.md files.

etraut-openai avatar Dec 17 '25 19:12 etraut-openai

Thanks for looking into this. I double-checked, and I’m still seeing the duplicate entry even when there is only one SKILL.md under ~/.codex/skills.

Environment

macOS (MacBook)

Codex: OpenAI Codex (v0.73.0) (as shown in the screenshot)

What I did

Removed everything under ~/.codex/skills except a single skill folder (brainstorming/).

Verified there is only one SKILL.md under that directory (and no other copies under ~/.codex).

Commands/checks (on my machine):

find ~/.codex/skills -name SKILL.md -print
# Output:
# /Users/lingguiwang/.codex/skills/brainstorming/SKILL.md

(Optional broader check I also ran:)

find ~/.codex -name SKILL.md -print
# Output is still only the same single path above

Repro

Start codex

Run /skills

The brainstorming skill is still listed twice (see attached screenshot)

From the screenshot, it looks like the exact same skill name/description is being printed twice. My filesystem insists it’s innocent—only one SKILL.md exists—so it seems like either:

the scan is picking up the same file twice, or

the /skills rendering is duplicating output (e.g., formatted block + plain line).

Screenshot attached showing the single ~/.codex/skills/brainstorming folder and the duplicated /skills output.

Image

canyangliunian avatar Dec 18 '25 03:12 canyangliunian

Do you have any other .codex folders elsewhere on your computer, such as in the repo?

ae-openai avatar Dec 18 '25 03:12 ae-openai

Thanks for the suggestion. I double-checked and I don’t have any other .codex folders elsewhere on my machine (including inside the repo). The only one is ~/.codex.

More importantly, I can reproduce the duplication even after reducing the skills directory to a single skill:

I removed everything under ~/.codex/skills except one folder: brainstorming/ (i.e., there is only one SKILL.md remaining).

Restarted codex, ran /skills.

Result: brainstorming still shows up twice.

This seems to rule out “multiple copies of SKILL.md across different .codex directories” as the cause. If there were another .codex/skills being scanned, I would expect at least an additional distinct source (or at minimum more than this consistent 2x duplication), but with only one skill present it’s still duplicated.

Happy to provide directory listings or find output if that helps debug further.

canyangliunian avatar Dec 18 '25 04:12 canyangliunian

Is it possible that you've created a symlink to a directory? That might cause the enumeration logic to visit your skills twice.

etraut-openai avatar Dec 18 '25 05:12 etraut-openai

I investigated the symlink / double-root hypothesis and it doesn’t appear to be the cause.

What I checked

Searched for symlinks under both skill roots:

find /Users/lingguiwang/.codex/skills -maxdepth 2 -type l -print

find /Users/lingguiwang/.codex/superpowers/skills -maxdepth 2 -type l -print Result: no symlinks found at depth ≤ 2, and both /Users/lingguiwang/.codex/skills and /Users/lingguiwang/.codex/superpowers/skills are normal directories (not symlinks).

Verified whether the duplicated skills could be coming from ~/.codex/superpowers/skills:

ls -1 /Users/lingguiwang/.codex/superpowers/skills | rg -n "^(latex|invoice-organizer)$" || true Result: no output (so those skills are not physically duplicated there).

Key evidence: duplication already exists in the session “instructions”

I inspected the session metadata JSONL:

/Users/lingguiwang/.codex/sessions/2025/12/18/rollout-2025-12-18T13-41-44-019b2ffa-807b-7350-965f-827686c37f06.jsonl

In the first JSON line (session_meta.payload.instructions), the skills list is already duplicated:

  • latex: appears 2 times

  • invoice-organizer: appears 2 times

This indicates the duplication is introduced earlier during startup (the “skills disclosure” block is being injected twice into the session instructions) and then the UI simply renders that duplicated block as-is. So it’s not caused by symlink loops or two physical copies of the same skill on disk.

I’m on Codex CLI v0.73.0. If you’d like, I can also paste the outputs of codex --version and codex --help, and the exact command I use to launch codex, to help pinpoint which startup layer is appending the block twice.

Image

canyangliunian avatar Dec 18 '25 06:12 canyangliunian

Update: I was able to eliminate the duplicate skills list by downgrading and restoring my skills directory.

Steps I took:

Uninstalled Codex CLI:

npm uninstall -g @openai/codex

Backed up my existing Codex state:

mv /Users/lingguiwang/.codex /Users/lingguiwang/.codex.backup.$(date +%Y%m%d-%H%M%S)

Reinstalled an older version (0.65.0):

npm install -g @openai/[email protected]

Copied my backed-up skills back into the fresh install:

cp -R /Users/lingguiwang/.codex.backup.*/skills /Users/lingguiwang/.codex/

After doing this, running /skills no longer shows duplicates. Screenshot attached (it also shows Codex reporting “Update available: 0.65.0 -> 0.73.0”), so this looks like a regression introduced after 0.65.0.

Image

Is it possible that you've created a symlink to a directory? That might cause the enumeration logic to visit your skills twice.

canyangliunian avatar Dec 18 '25 07:12 canyangliunian

Thanks for reporting this.

In addition to ~/.codex/skills, Codex also scans the current working directory/repo. In your screenshot, the working directory is ~, which results in duplicate scans. You can verify this by running Codex from a different folder.

For your reference, we’ve added deduplication logic in a recent alpha release, so this issue should now be officially fixed.

xl-openai avatar Dec 18 '25 09:12 xl-openai