Support user-defined local slash commands in interactive Codex sessions
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.
5 Comments
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.
@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.
@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.
@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.
Codex Skills Referring to Other Skills
@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.
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):
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:
B) referring to skill names with language like
load <skill name>,use <skill name>orswitch to <skill name>in aSkill Boundariessection:Sources:
---
So for Codex, skill composition appears to be possible with a parent/orchestrator skill like this: