Support user-defined local slash commands in interactive Codex sessions

Resolved 💬 5 comments Opened Apr 21, 2026 by nevertoday Closed Apr 21, 2026

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 ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗