Cmd. /mention
Attach a file or path to the conversation.
Key takeaways
- Attach a file or path to the conversation.
- Check the input surface and availability before using the examples below.
Purpose
Attach a file or path to the conversation.
/mention <path>Availability
| Field | Value |
|---|---|
| Input surface | Running CLI prompt |
| Kind | Built-in |
| Status | Current reference |
| Aliases | — |
| Documented minimum | Not specified |
| Reviewed against | 2026-09-22 · Codex CLI 0.155.1 |
The installed command menu and account or organization settings determine availability.
Examples
/mention src/main.tsWhen to use it
- Mention the file that contains the failing behavior before asking for a fix.
- Mention a design doc or config file when the next request depends on it.
Choosing related commands
| Command | Difference | Choose It When |
|---|---|---|
/mention | Attaches one-off file context | The next turn needs a specific path |
/init | Creates persistent repo instructions | The context should live across sessions |
/status | Shows current workspace state | You need to confirm roots and policy |
Effects and persistence
References a selected file or path in the prompt without editing the file merely by mentioning it.
/mention highlights a file or folder for Codex so the next turns can reference that context
directly.
Cautions
- Mention only the files that matter; too much context can distract the model.
- Do not mention files containing secrets unless the task truly requires it and the policy allows it.
Official sources
Complete command list · Verification scope · History for this command