Look for custom prompts in {project root}/.codex/prompts/ first
What feature would you like to see?
People are using development tools (such as Codex CLI) to work on multiple projects. Some of us have project-specific custom prompts, and even SHARED custom prompts, version controlled in project repos. Both are great reasons why global ~/.codex/prompts/ is not good enough.
Yes, I can do CODEX_HOME=pwd/.codex/ every time I switch to another project or worktree, that is (a) a rather silly hoop to jump through, but more importantly (b) I now have all the stuff that SHOULD live in ~/.codex split between multiple locations. Yuck!
Proposal: search for /custom-prompt should look for {project root}/.codex/prompts/custom-prompt.md first, then go to $CODEX_HOME or ~/.codex
Additional information
No response
May this help you in meanwhile : https://github.com/openai/codex/issues/4715#issuecomment-3368447587
Running into same problem. Codex should support multiple places to looking for prompts. There should be a system wide codex config as well as project specific. Overriding system wide doesn't work since that's where auth setting are stored
Oh, and one more think. With my little linux envrc trick, or my python package custom prompts works for codex-cli, it's still broken in codex ide (vscode extension) ! I dont even understand how this extension is meant to be used effectively !
This feature will be important later was we will want to use custom prompts when we run tasks in the cloud. If they are in the projects .codex directory, then the prompts directory can live in the repo and the cloud tasks can have access to the prompts.
That would be must have to not being forced using agent locally, with customs prompts and same feature than CLI and vscode extension !
can't see how this is not implemented from the beginning. I totally second the request to have a project based folder for prompts (and config as well)
can't see how this is not implemented from the beginning. I totally second the request to have a project based folder for prompts (and config as well)
Have you tried my little project ? If this might help you: https://github.com/Hotion13/cx-prompts It'll hardlink your custom prompts to your user home codex folder.
Tell me if it's work for you too. I'll delete it when this will be implemented by codex....
Thanks for your work and for pointing it out. I might try this later.
The feature is really needed because using the spec-kit on codex is too painful.
This is related to #3706
I found a temporary workaround for project-specific prompts that may help others until native support is available.
In my project root, I created an executable script at: .codex/bin/test-coverage.sh with the following content:
#!/bin/bash
codex [YOUR_CODEX_OPTIONS] ".codex/instructions/default.agent.md .codex/prompts/test-coverage.md Focus only on analyzing the existing code for test coverage needs. Do not generate any unit tests yet—wait for my next instruction."
Then I simply run: .codex/bin/test-coverage.sh
This initializes the agent with prompts scoped to the project.
It’s not ideal, since you need to exit and restart another agent when switching tasks (or run multiple Codex sessions and swap between them), but it works reliably for now.
Native project-level prompt loading would make this much smoother, especially when versioning prompts within the repository.
Are there any plans to add this to one of the upcoming releases ? 😔
Please add local .codex folder support