Custom Slash Commands in Codex

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

Dec 7, 2025 · 1 min read · 87 Words · -Views -Comments · Programming
Codex AI 🇨🇳 阅读中文版
Read with AI

Choose an AI assistant

ChatGPT Open in a new tab with the article link and prompt
Claude Copy the prompt, then open Claude

Open Claude
Trouble reading the article?

If the prompt is missing, copy the full prompt below into your AI assistant. If the AI cannot read the article, paste the visible passage you want to discuss and add your question.

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