Feature Request: Persistent Pre-Prompt via `/prep` Command a **persistent pre-prompt** that is automatically prepended to every user prompt in a Codex session.
What feature would you like to see?
Feature Request: Persistent Pre-Prompt via /prep Command
Description
Add support for a persistent pre-prompt that is automatically prepended to every user prompt in a Codex session.
Proposed command:
/prep "instruction text"
Once set, the provided text is prepended to every subsequent prompt sent to the model.
Example
User runs:
/prep "Always preserve existing functionality. Output full dataset only."
Then types:
Change the value on line 5 to 42.
Codex sends internally:
Always preserve existing functionality. Output full dataset only.
Change the value on line 5 to 42.
This applies to all prompts until changed or cleared.
Motivation
Many Codex workflows require consistent constraints across multiple turns (e.g. coding conventions, no refactors, preserve comments, project-specific rules).
Currently, users must retype these instructions every prompt or risk the model ignoring them even if in Agents.md A persistent pre-prompt removes that friction and improves consistency without changing model behavior.
Expected Behavior
-
/prep "text"sets the active pre-prompt - Pre-prompt is prepended to every prompt
- Persists for the current session
- No changes to normal prompt handling otherwise
-
/prep clearto remove it
Scope
This is a lightweight client-side feature:
- No model changes required
- Simply concatenate pre-prompt + user prompt before submission and display pre-prompt with user prompt and/or preview pre-prompt on input line.
Why This Fits Codex
- Improves iterative coding workflows
- Reduces accidental constraint violations
- Aligns with how advanced users already work
- Minimal surface area, predictable behavior
Additional information
No response
The Codex CLI already supports custom prompts. Does this meet your needs?
@etraut-openai > The Codex CLI already supports custom prompts. Does this meet your needs?
Not exactly... The idea is say you want something to be sent to CODEX every turn something like a short reminder in addition to agents etc. You set it once and then while typing any other prompt it automatically adds it to the front of your prompt. Like I put above..
Example
User runs:
/prep "Always preserve existing functionality. Output full dataset only."
Then types:
Change the value on line 5 to 42.
Codex sees internally:
Always preserve existing functionality. Output full dataset only.
Change the value on line 5 to 42.
User types
Inspect line 142 for borrow errors.
Codex sees
Always preserve existing functionality. Output full dataset only.
Inspect line 142 for borrow errors.
This applies to all prompts until changed or cleared.
What your describing sounds like it would have to be setup then invoked by adding the placeholders still with every prompt. The idea is this would be inserted to every prompt until you disable or change it in session.
The AGENTS.md file provides a mechanism for persistent instructions that are prepended to every prompt. It sounds like what you're describing here is an ephemeral, non-persisted extension to AGENTS.md.
The
AGENTS.mdfile provides a mechanism for persistent instructions that are prepended to every prompt. It sounds like what you're describing here is an ephemeral, non-persisted extension to AGENTS.md.
Yeah basically like a system prompt you can change when you need to by just doing /Prep "Prompt" and it keeps feeding it until you change it.
But I've found that sometimes CODEX forgets things even in Agents and adding key details even just a tiny one or 3 word reminder for important stuff keeps it on track and keeps it aligned better.
Like I might say... "Suggest next tasks at the end of your summary based on the plan checklist and design docs.".
If I leave that in Agents it does it prolly 80-90% of the time..
If I say "Suggest next tasks at the end" in front of every prompt and have that line in agents? It never fails to do it.