Custom Slash Commands in Codex

Dec 7, 2025 · 1 min read · 87 Words · -Views -Comments

Custom slash commands in CC are really convenient. For example, I often perform specific operations directly with slash commands, which is efficient. The Codex CLI can achieve similar functionality.

Create prompts file

  1. Create a prompts folder in your user’s home directory, not in the project directory.

    mkdir -p ~/.codex/prompts
    
  2. Edit the prompt file Create a new text file in the ~/.codex/prompts/ directory, such as deploy.md, and write your desired prompt content.

Restart Codex session

Type /prompts:deploy-dev and press enter to execute the target command.

codex-custom-slash-command-1

Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover