Custom prompts - passing arguments
Resolved 💬 31 comments Opened Aug 29, 2025 by michalkos Closed Oct 3, 2025
💡 Likely answer: A maintainer (dedrisian-oai, contributor)
responded on this thread — see the highlighted reply below.
What feature would you like to see?
Please implement functionality to allow custom arguments (e.g., $ARGUMENTS) to be passed and rendered within the .md file when executing slash commands.
Additionally, the first line of the .md file could be used as a command title in the TUI. If the line exceeds the maximum allowed length, it should be truncated accordingly.
<img width="470" height="98" alt="Image" src="https://github.com/user-attachments/assets/f9068bba-6258-4d53-a84c-eef2ccbdb943" />
Once [pull request #2471](https://github.com/openai/codex/pull/2471) is merged, it would be great to support this functionality in custom commands as well.
Example
# Create a git commit
Based on the code changes, create a single git commit.
If `--push` argument is present, you can run `git push`.
**DO NOT** run `git add` unless asked by argument `--add`.
**DO NOT** add information that the commit is generated by Codex.
## Context
- Current git status: !`git status`
- Current git diff (staged and unstaged changes): !`git diff HEAD`
- Current branch: !`git branch --show-current`
- Recent commits: !`git log --oneline -10`
## Passed arguments
`$ARGUMENTS`
Are you interested in implementing this feature?
_No response_
Additional information
_No response_
31 Comments
+1, would be really useful! i was just reading the source code to understand if this was already there!
+1, arguments to saved prompts and adding additional content like this is super useful
It would be nice to have a more Git centric approach where codex ask if you want to create a new branch for this change.
Also does appropriate Git commits along the way so if you leave it running the user and Codex can easily step back to a point where it was in a working state regardless of Codex running or not.
This way you can see in the Git logs the branches and iterative changes over time to pick up any mistakes or changes that may be important or may have caused problems.
As this also would you help diagnose issues and looking at the state of repository with the many, many tools available for Git repository viewing and analysis out there already.
@SuperPauly, how you configure the command is entirely up to you. The example simply demonstrates how to use arguments in the setup.
Thanks! Tracking this.
+1 That would be very useful, thanks!
This will make prompts much more powerful. Imo ideally we should be able to pass multiple arguments with
$1,$2, ...i initially thought i could use something like:
/code-review pass PR linkand do it, but just found out, that it doesn't accept any args... Hope they will implement this soon.This will be a game changer for me. I rely on this a ton with Claude Code. +1
Status update / proposal
(literal); simple quoting for paths with spaces.
content inlining, no auto‑exec).
hint shown in the slash palette; frontmatter is
stripped before send.
sandbox; protocol only adds optional fields; existing
prompts continue to work.
prompts.md updated.
If this approach aligns, I’ll mark #3565 ready for
review. I’m happy to modify as needed.
Hi @dedrisian-oai and @aibrahim-oai - PR #3565 (https://github.com/openai/codex/pull/3565) mentioned above which shows high demand, delivers the full custom prompt update: $1..$9/$ARGUMENTS/$$ handling, @ file picker auto-quoting, inline description + argument-hint rendering, and the docs/tests refresh. It’s rebased on current main and the sweeps (formatting, per-crate tests, cargo test --all-features) are green. It’s still in draft mode and I can’t switch it back to active - could you unlock the PR and mark it ready for review? Please me know if you’d like any changes.
<img width="534" height="336" alt="Image" src="https://github.com/user-attachments/assets/8a4a8894-c660-4dec-adb0-f158ccdea639" />
<img width="534" height="421" alt="Image" src="https://github.com/user-attachments/assets/201238f9-fef5-43f9-936f-8719792af989" />
See also, recent duplicate:
Yeah, this high demand is justified: extensibility is key to creating prompt frameworks and libraries.
The documentation of spec-kit itself names this issue as a blocker, while almost every other tool in the long list already supports it.
Codex CLI, despite offering arguably the best model and usage conditions, has the weakest extensibility of all. That is especially frustrating given that multiple pull requests have already been proposed to resolve it.
I hope the official maintainers will notice this issue soon and give it the priority it deserves.
GPT5 is defiantly leading the model race, we need a top CLI agent with the GPT subscription :) @codex-maintainers please help here. Thank You.
From a personal point of view, I don't really like the $1...$9 args and $ARGUMENTS params.
I feel like people should use named params. In my proposal, we use something like:
Would then manifest in the CLI as:
This removes any ambiguity for the user, especially when the args are automatically rendered once you select the custom prompt. I also don't see the use for $ARGUMENTS -- is there a specific example that would make sense for it?
Thanks everyone!
The use case I am interested in is not something I invented — it comes directly from the spec-kit README.
The README shows examples where a command is followed by arbitrary free-form text, not just named parameters. For example:
/specify Build an application that can help me organize my photos in separate photo albums. Albums are grouped by date and can be re-organized by dragging and dropping on the main page. Albums are never in other nested albums. Within each album, photos are previewed in a tile-like interface./plan The application uses Vite with minimal number of libraries. Use vanilla HTML, CSS, and JavaScript as much as possible. Images are not uploaded anywhere and metadata is stored in a local SQLite database.This usage pattern is part of spec-kit’s own documentation, and it doesn’t map cleanly to named parameters. That’s why support for $ARGUMENTS is essential — it makes it possible to implement the examples shown in the referenced README.
Alright fair! We can support both.
What is the latest on Custom prompts - passing arguments? When will this feature be available?
We need this now please :)
A message above said this feature is now on a branch and should be merged into main soon.
I this this is this feat : #3565
We all hope for this. Codex is replacing CC for lot of us, and spec kit hype is growing fast :)
Hey @dedrisian-oai, will this feature be in the upcoming 0.43 release?
Thanks a lot!
Hey guys, coming soon! @evandavid1's PR was merged into a feat branch, and I'll combine it with some named params and submit for a PR & review this week.
Numbered args ($1, $2, $3, $ARGUMENTS) has been merged. Named args coming next!
We can't work with the GitHub Spec kit (Codex) without this.
Both numbered args and named args have been merged! It will be released in the next version :)
just run the
/constitution <input text>custom prompt on the latest build and everything looks working.Can we officially use Codex with the Spec kit and passing an argument? Is it official or experimental?
I think it might be in v0.43.0 . But its not released yet.
Latest codex cli version now supports custom commands
Expanded documentation at:
https://github.com/openai/codex/blob/main/docs/prompts.md