codex icon indicating copy to clipboard operation
codex copied to clipboard

[BUG] Codex cannot discover scripts in skill's scripts directory

Open PaulRBerg opened this issue 10 months ago • 9 comments

What version of Codex is running?

codex-cli 0.80.0

What subscription do you have?

Pro

Which model were you using?

Codex 5.2 High/Medium

What platform is your computer?

Darwin 25.2.0 arm64 arm

What issue are you seeing?

Image

When a skill includes a scripts directory with executable scripts (e.g., Python scripts), Codex fails to discover and use them. Instead, it:

  1. Lists the scripts directory but reports it as empty
  2. Searches for scripts by name (e.g., rg --files -g 'scan-*.py') but doesn't find them
  3. Falls back to using reference files for manual patterns, concluding "no scripts are available"

The scripts exist on disk and work correctly when invoked manually or through Claude Code.

What steps can reproduce the bug?

  1. Create a skill with a scripts directory containing executable scripts (e.g., .claude/skills/codebase-audit/scripts/scan-react.py)
  2. Reference these scripts in the skill's SKILL.md file
  3. Run Codex and invoke the skill
  4. Observe that Codex cannot find or use the scripts, despite them existing at the expected path

What is the expected behavior?

Codex should:

  • Correctly discover scripts in the skill's scripts directory
  • Be able to execute these scripts when the skill instructions reference them
  • Have the same file discovery capabilities as Claude Code for skill components

Additional information

Screenshot showing the issue:

  • Codex "Explored" → List scripts but found the folder empty
  • Codex searched with rg --files -g 'scan-*.py' but found nothing
  • Codex concluded "since no scripts are available" and fell back to reference files

This suggests either:

  1. The working directory context is incorrect when listing the scripts folder
  2. The scripts directory path is not being resolved relative to the skill's location
  3. There's a sandboxing or permission issue preventing file discovery in skill directories

PaulRBerg avatar Jan 14 '26 21:01 PaulRBerg

Thanks for the bug report.

How are you referencing the script within your skill file? Does it use a relative path? I ask because we received a similar report about relative paths from an internal (OpenAI) user.

etraut-openai avatar Jan 16 '26 01:01 etraut-openai

Like this:

# Workflow

## Step 1: Run Checks

Use the domain-specific scanners in `scripts/` to identify issues.

### Running Checks

```bash
# List checks in a domain
python scripts/scan-tailwind.py --list

# Run a single check (files only)
python scripts/scan-tailwind.py 01
```

And the scripts are defined in .claude/skills/codebase-audit, with .codex directory symlinked to .claude.

PaulRBerg avatar Jan 16 '26 12:01 PaulRBerg

I can reproduce this issue. Will work on a fix.

xl-openai avatar Jan 16 '26 23:01 xl-openai

Possibly related

  • #10264

zbynekwinkler avatar Feb 01 '26 13:02 zbynekwinkler

Personally I’d just edit the skill creator SKILLS.md to the full path or paths it needs to check but can’t say that’s the best way.

evoNick-A avatar Feb 01 '26 15:02 evoNick-A

Any updates on this?

deeepanshu avatar Apr 28 '26 05:04 deeepanshu

I noticed Codex Desktop Windows gave me this message today:

The workspace doesn’t have the scripts/generate_pipeline_report.py path the skill expects. I’m checking the installed skill/plugin directories for the generator before deciding whether to create the report directly with the available document tooling.

It's right there. I'm following the conventions established in Using scripts. How is Codex unaware of a Skill's own Scripts? 🫤

whitford-olmst avatar Jun 25 '26 00:06 whitford-olmst

Yeah this has continued to happen for me, too.

I noticed that this very rarely happens with xhigh. But with less intelligent models, it happens often.

PaulRBerg avatar Jun 25 '26 06:06 PaulRBerg

I noticed that this very rarely happens with xhigh. But with less intelligent models, it happens often.

Interesting because I tend to use Medium / 5.5 / Standard.

whitford-olmst avatar Jun 25 '26 07:06 whitford-olmst