C.W.K.
Stream
Lesson 07 of 11 · published

Slash Commands & Custom Commands

~12 min · codex, slash, commands, automation

Level 0🌱 Novice
0 XP0/70 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

Built-ins + your own

Codex's slash commands cover the same ground as Claude Code's: /help, /permissions, /compact, /clear, /theme, /cost, /model. /init bootstraps an AGENTS.md from the project. Custom commands live in .codex/commands/<name>.md; the body becomes the prompt, $ARGUMENTS substitutes whatever you typed after.

Code

Built-in commands you'll actually use·text
/help            # full reference
/permissions     # browse / change approval mode + sandbox
/compact         # squeeze conversation history
/cost            # session $$$
/model gpt-5-codex
/clear           # reset conversation
/theme github-dark --save
/init            # generate AGENTS.md from project state
Custom /review command·markdown
# .codex/commands/review.md
Review the file at $ARGUMENTS for:

1. Logic bugs and edge cases
2. Security: SQL injection, XSS, auth bypass
3. Performance: N+1 queries, blocking I/O
4. Style violations against AGENTS.md

Output:
[SEVERITY] description (file:line)
- Sort by severity descending.
- If no findings, print "No issues."

External links

Exercise

Write a custom Codex command for a recurring task (review, summarize, refactor). Save to .codex/commands/. Run it on real input twice; iterate the prompt.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.