Skip to content

Support user-defined local slash commands in interactive Codex sessions #18857

@nevertoday

Description

@nevertoday

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayconfigIssues involving config.toml, config keys, config merging, or config updatesenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions