Support user-defined local slash commands in interactive Codex sessions

Resolved 💬 5 comments Opened Apr 21, 2026 by nevertoday Closed Apr 21, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What variant of Codex are you using?

CLI

What feature would you like to see?

I would like Codex to support user-defined slash commands in interactive sessions that can run local actions directly, without sending anything to the model.

Today there are partial workarounds, but none of them solve this cleanly:

  • custom prompts / skills still invoke the model and consume usage
  • hooks are event-driven, not user-invoked
  • shell aliases/scripts require breaking out of the Codex conversation flow

What I want is something like:

  • /open -> open the current working directory in Finder
  • /reveal README.md -> reveal a file in Finder
  • /copy-path -> copy the current workspace path
  • /run-local-task -> run a deterministic local shell/MCP action

The key requirement is that these commands should be treated as local commands, not prompts:

  • no model invocation
  • no token / usage cost
  • fast deterministic execution
  • visible output / confirmation in the current session

A possible design would be a dedicated config surface for local slash commands (for example ~/.codex/commands or config.toml), where a command can map to:

  • a shell command
  • an MCP prompt/tool
  • an app action

This would make Codex much more usable for day-to-day interactive workflows, especially for users coming from tools like Claude Code where lightweight slash-driven local workflows are common.

Additional information

Related but not the same as existing requests:

  • #3641 is about slash commands in codex exec mode
  • #7480 is about custom commands in the VS Code extension

This request is specifically about interactive Codex sessions: while I am actively chatting with Codex, I want to be able to run a local slash command such as /open without context-switching to a separate terminal and without paying model usage for something deterministic and local.

View original on GitHub ↗

5 Comments

etraut-openai contributor · 4 months ago

We previously supported user-defined slash commands, but they were deprecated and removed in favor of skills, which provide a superset of the functionality. We therefore don't have any plans to reintroduce slash commands.

jeevanpillay · 4 months ago

@etraut-openai thats straight bs. there are use-cases for slash commands that work outside of skills.

skills run whenever the agent think it needs to run it.
commands run when dev wants it run.

this is forcing a dev to have less configurability in workflows.

e.g we run /research_codebase before doing anywork in claude. and run /create_plan after. with slash commands these primitives dont exists.

etraut-openai contributor · 4 months ago

@jeevanpillay, you can specify that a skill should not be run automatically. See here for details. This was added to address the point you're raising.

shafty023 · 3 months ago

@etraut-openai a nice thing about a slash command is it allows you to define multiple skills in a single workflow. I can define a slash command in claude that specifies multiple skills to automatically inherit. I can't do that with the current skills support in codex.

karlhorky · 1 month ago

Codex Skills Referring to Other Skills

I can define a slash command in claude that specifies multiple skills to automatically inherit. I can't do that with the current skills support in codex.

@shafty023 can you provide a link to the Claude Code docs? I don't see a feature that's exactly what you are describing. Maybe you mean Claude Code's "stack several skills at the start of one message" feature? Eg.

/code-review /fix-issue 123 loads both skills and passes the trailing text 123 as $ARGUMENTS to each of them

Source: https://code.claude.com/docs/en/skills#pass-arguments-to-skills

---

For Codex, from the official OpenAI plugins, @etraut-openai mentioned that skills can refer to other skills (although this appears to be undocumented):

Skills can be nested (refer to each other) and combined with each other.

Source: https://github.com/openai/codex/issues/11075#issuecomment-3867649874

Looking at the official OpenAI plugins repo, references to other skills are achieved by either:

A) using relative paths in Markdown:

---
name: sharepoint-spreadsheets
description: Edit SharePoint-hosted spreadsheet files while preserving workbook structure, formulas, and formatting. Use when the user wants to update a real spreadsheet in SharePoint rather than summarize extracted sheet text.
---

# SharePoint Spreadsheets

Use this skill for `.xlsx` edits that start from SharePoint. Inspect the workbook structure before editing, preserve formulas and formatting, and upload the revised workbook back to the same SharePoint item only after verifying the exact change.

If the formula itself is the task, pair this with ../sharepoint-spreadsheet-formula-builder/SKILL.md so formula design, syntax checks, and rollout choices stay deliberate instead of being improvised during the workbook edit.

B) referring to skill names with language like load <skill name>, use <skill name> or switch to <skill name> in a Skill Boundaries section:

---
name: figma-generate-design
description: Use this skill alongside figma-use when the task involves translating an application page, view, or multi-section layout into Figma. Triggers: 'write to Figma', 'create in Figma from code', 'push page to Figma', 'take this app/page and build it in Figma', 'create a screen', 'build a landing page in Figma', 'update the Figma screen to match code', 'convert this modal/dialog/drawer/panel to Figma'.
---

MANDATORY: You MUST also load figma-use before any `use_figma` call. That skill contains critical rules (color ranges, font loading, etc.) that apply to every script you write.

## Skill Boundaries

- If the user wants to create new reusable components or variants, use figma-use directly.
- If the user wants to write Code Connect mappings, switch to figma-code-connect.

Sources:

---

So for Codex, skill composition appears to be possible with a parent/orchestrator skill like this:

---
name: prepare-pr
description: Use when preparing a pull request for review. Runs the repo's normal PR preparation workflow in order.
---

Prepare this pull request for review.

Follow these steps in order:

1. Use `../repo-inspection/SKILL.md` to understand the changed files and surrounding code.
2. Use `../typecheck/SKILL.md` to run type checks and fix narrow type errors.
3. Use `../test-runner/SKILL.md` to run relevant tests and fix narrow test failures.
4. Use `../code-review/SKILL.md` to review the final diff.
5. Write a concise PR summary with:
   - what changed
   - how it was tested
   - risks or follow-ups

Do not refactor unrelated code.
Do not expand the scope beyond preparing the current diff for review.
Stop and explain blockers if a required check cannot be run.