codex - 💡(How to fix) Fix Support user-defined local slash commands in interactive Codex sessions [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#18857Fetched 2026-04-22 07:51:22
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4closed ×1commented ×1

Fix Action

Fix / Workaround

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
RAW_BUFFERClick to expand / collapse

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.

extent analysis

TL;DR

Implementing a dedicated config surface for local slash commands in Codex could enable fast, deterministic execution of user-defined actions without model invocation.

Guidance

  • Investigate the feasibility of introducing a new configuration file (e.g., ~/.codex/commands or config.toml) to store user-defined slash commands and their corresponding local actions.
  • Consider mapping each command to a specific shell command, MCP prompt/tool, or app action to enable flexible execution.
  • Evaluate the potential for integrating this feature into interactive Codex sessions, ensuring that local commands are treated differently from model prompts.
  • Review related requests (#3641 and #7480) to ensure the proposed solution aligns with existing efforts and avoids duplication.

Example

No code snippet is provided, as the issue focuses on the design and implementation of a new feature rather than a specific code-related problem.

Notes

The proposed solution may require significant changes to the Codex architecture and configuration. It is essential to carefully evaluate the feasibility and potential impact of introducing user-defined slash commands on the overall system.

Recommendation

Apply a workaround by exploring alternative tools or scripts that can provide similar functionality to user-defined slash commands, as implementing this feature may require significant development and testing efforts.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Support user-defined local slash commands in interactive Codex sessions [1 comments, 2 participants]