Support project-scoped custom prompts in `.codex/prompts` (repo root + cwd)
Resolved 💬 5 comments Opened Jan 25, 2026 by vjain419 Closed Jan 25, 2026
Summary
Custom slash prompts are currently only loaded from $CODEX_HOME/prompts. Please also load prompts from project-scoped .codex/prompts directories (repo root and any .codex directories between repo root and CWD), similar to how skills are loaded.
Why this matters
In monorepos and large repos, teams want to share prompts at the project/team level without requiring per-user setup or symlinks. Keeping prompts in the repo makes them versioned, reviewable, and portable across machines/CI.
Current behavior (code pointers)
codex-rs/core/src/custom_prompts.rs:default_prompts_dir()returns only$CODEX_HOME/prompts.discover_prompts_in(...)reads a single directory.codex-rs/core/src/codex.rs:list_custom_promptsonly callsdefault_prompts_dir()and thendiscover_prompts_in(...).- There is no project/CWD prompt discovery path.
Proposed behavior
- Discover prompts from project-scoped
.codex/promptsdirectories, in order of precedence from CWD → repo root (same traversal as project config layers). - Keep
$CODEX_HOME/promptsas a fallback (lowest precedence). - De-duplicate by prompt name with “highest precedence wins”.
- Apply the same trust rules used for project layers (i.e., if a
.codexdir is untrusted/disabled, consider skipping its prompts or marking them disabled).
Suggested precedence order:
CWD/.codex/prompts- Parent
.codex/promptsup to repo root $CODEX_HOME/prompts
Implementation notes (sketch)
- Add a prompt-roots helper that mirrors
skills::loader::skill_roots_from_layer_stackbut returns.codex/promptsdirectories for project/user layers. - In
codex::list_custom_prompts, enumerate all roots in precedence order and calldiscover_prompts_in_excluding(...)(or add a similar helper) to avoid duplicates by name. - Add tests to
custom_prompts.rsor config/skills tests to cover: - Repo root + nested
.codex/promptsboth present - CWD precedence over repo root
- Fallback to
$CODEX_HOME/prompts - Trust/untrusted behavior if applicable
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗