Execute prompt(s) from the ./prompts/ directory.
Usage
Arguments: $ARGUMENTS
Parse the arguments to determine:
- Prompt number(s): One or more 3-digit numbers (e.g., 001, 002, 003)
- Execution mode:
--parallel or --sequential (default: sequential)
- Model override:
--model ... (accepted for compatibility; ignore unless the available execution tool supports model selection)
- Effort override:
--effort low|medium|high|xhigh|max (accepted for compatibility; treat as advisory unless the available execution tool supports effort controls)
- Auto mode:
--auto (accepted for compatibility; Codex has no slash-command auto mode, so report that it is unavailable and continue manually)
Execution Steps
- Parse arguments to extract prompt numbers, execution mode, model override, effort override, and auto flag
- Locate prompt files in ./prompts/ matching the pattern
[number]-*.md
- Read each prompt file to get the prompt content. Effort precedence: CLI flag > prompt-file hint (e.g.,
Run at xhigh or YAML frontmatter effort:) > session default.
- Execute prompts according to the specified mode
Sequential (default):
- Execute one at a time, wait for completion before starting next
- Between prompts, check context utilization. For multi-step chains where decisions or file paths must carry forward, write a state-handoff note to
./prompts/.state/[number]-handoff.md before any compaction or handoff, capturing: decisions made, files modified, assumptions, and any deferred work.
- If a prompt fails, report what failed and ask whether to continue.
Parallel:
- Launch each prompt as a separate subagent when multi-agent tooling is available. State the parallel intent explicitly when invoking.
- If
--model or --effort overrides are specified and the tool supports them, pass them through to each subagent.
- Collect and report results as subagents complete
Auto mode (--auto):
- Codex has no slash-command auto mode in this environment.
- Warn once, then continue in manual sequential or parallel mode according to the other flags.
Examples
/run-prompt 001 # Single prompt at session default effort
/run-prompt 001 002 003 # Run sequentially
/run-prompt 001 002 --parallel # Parallel via subagents
/run-prompt 001 002 003 --sequential # Explicitly sequential
/run-prompt 005 --model haiku # Specific model
/run-prompt 005 --effort low # Lower effort for narrow well-specified work
/run-prompt 010 011 --parallel --effort high # Parallel subagents at high effort
/run-prompt 020 021 022 --auto # Specified chain, no check-ins
Execution
First, list the ./prompts/ directory to find matching files:
ls ./prompts/ 2>/dev/null | grep -E "^[0-9]{3}-" | sort -V
For each prompt number provided:
- Find the file matching pattern
[number]-*.md
- Read the prompt content
- Capture any effort hint declared in the file
- Resolve effort using precedence (CLI flag > file hint > session default)
- Execute the prompt content as instructions, applying the resolved effort level
For parallel mode: use available multi-agent tooling to launch each prompt as a separate subagent, with explicit fan-out language ("Spawn parallel subagents, one per prompt; do not consolidate"). If no such tooling is available, report that and ask whether to run sequentially.
For sequential mode: execute prompts in order. Between prompts where the prior step did heavy file reading, exploration, or produced state the next prompt depends on:
- Write
./prompts/.state/[N]-handoff.md with decisions, file paths, assumptions, deferred items
- If compaction or a new session is needed, use that handoff note as the durable summary
- The next prompt's first action is to read its handoff note
For auto mode: Codex does not expose slash-command auto mode here. Warn once and continue manually.
Effort Level Reference
When the user has not specified --effort, suggest one based on the prompt's scope:
xhigh / high effort — most agentic coding: schema design, multi-file refactors, code review across a service, ambiguous debugging, multi-step agentic chains
high — concurrent sessions, cost-sensitive agentic work where xhigh is overkill
medium / low — narrow, well-specified tasks: classification, extraction, format conversion, single-file targeted fixes
max — only for genuinely hard problems where xhigh underperforms; prone to overthinking, diminishing returns
If a prompt's task is clearly narrow on read, prompt the user: This looks tightly scoped. Run with --effort low to save tokens? (y/N).
Error Handling
- If
./prompts/ directory doesn't exist: No ./prompts/ directory found. Run /prompt to create prompts first.
- If prompt number not found: List available prompts with numbers and names, ask which to run
- If no arguments provided: List all available prompts and ask which to run
- If a prompt fails during execution: Report the specific error, what was attempted, what succeeded before the failure, and any state-handoff notes already written. Ask whether to continue with remaining prompts.
- If
--auto is requested: warn that Codex auto mode is unavailable in this environment and fall back to manual mode
- If
--effort is set to a value the current model doesn't support: warn and use the closest supported level
After Execution
Report concisely:
- Which prompts ran, pass/fail status, and effort level applied to each
- Files created or modified (list paths)
- Verification results (test output, lint, typecheck)
- State-handoff notes written (paths)
- Suggested next action if applicable
For long chains, optionally wire a hook-based completion notification (sound, desktop notification) if the user asks.
1---2name: run-prompt3description: Use when asked to execute one or more saved prompts from `./prompts/`, including the old /run-prompt command syntax. Supports sequential execution by default and parallel execution when multi-agent tooling is available.4---56Execute prompt(s) from the ./prompts/ directory.78## Usage910Arguments: $ARGUMENTS1112Parse the arguments to determine:13- **Prompt number(s)**: One or more 3-digit numbers (e.g., 001, 002, 003)14- **Execution mode**: `--parallel` or `--sequential` (default: sequential)15- **Model override**: `--model ...` (accepted for compatibility; ignore unless the available execution tool supports model selection)16- **Effort override**: `--effort low|medium|high|xhigh|max` (accepted for compatibility; treat as advisory unless the available execution tool supports effort controls)17- **Auto mode**: `--auto` (accepted for compatibility; Codex has no slash-command auto mode, so report that it is unavailable and continue manually)1819## Execution Steps20211. **Parse arguments** to extract prompt numbers, execution mode, model override, effort override, and auto flag222. **Locate prompt files** in ./prompts/ matching the pattern `[number]-*.md`233. **Read each prompt file** to get the prompt content. **Effort precedence:** CLI flag > prompt-file hint (e.g., `Run at xhigh` or YAML frontmatter `effort:`) > session default.244. **Execute prompts** according to the specified mode2526### Sequential (default):27- Execute one at a time, wait for completion before starting next28- Between prompts, check context utilization. For multi-step chains where decisions or file paths must carry forward, write a state-handoff note to `./prompts/.state/[number]-handoff.md` before any compaction or handoff, capturing: decisions made, files modified, assumptions, and any deferred work.29- If a prompt fails, report what failed and ask whether to continue.3031### Parallel:32- Launch each prompt as a separate subagent when multi-agent tooling is available. State the parallel intent explicitly when invoking.33- If `--model` or `--effort` overrides are specified and the tool supports them, pass them through to each subagent.34- Collect and report results as subagents complete3536### Auto mode (`--auto`):37- Codex has no slash-command auto mode in this environment.38- Warn once, then continue in manual sequential or parallel mode according to the other flags.3940## Examples4142```43/run-prompt 001 # Single prompt at session default effort44/run-prompt 001 002 003 # Run sequentially45/run-prompt 001 002 --parallel # Parallel via subagents46/run-prompt 001 002 003 --sequential # Explicitly sequential47/run-prompt 005 --model haiku # Specific model48/run-prompt 005 --effort low # Lower effort for narrow well-specified work49/run-prompt 010 011 --parallel --effort high # Parallel subagents at high effort50/run-prompt 020 021 022 --auto # Specified chain, no check-ins51```5253## Execution5455First, list the ./prompts/ directory to find matching files:5657```bash58ls ./prompts/ 2>/dev/null | grep -E "^[0-9]{3}-" | sort -V59```6061For each prompt number provided:621. Find the file matching pattern `[number]-*.md`632. Read the prompt content643. Capture any effort hint declared in the file654. Resolve effort using precedence (CLI flag > file hint > session default)665. Execute the prompt content as instructions, applying the resolved effort level6768For **parallel mode**: use available multi-agent tooling to launch each prompt as a separate subagent, with explicit fan-out language ("Spawn parallel subagents, one per prompt; do not consolidate"). If no such tooling is available, report that and ask whether to run sequentially.6970For **sequential mode**: execute prompts in order. Between prompts where the prior step did heavy file reading, exploration, or produced state the next prompt depends on:711. Write `./prompts/.state/[N]-handoff.md` with decisions, file paths, assumptions, deferred items722. If compaction or a new session is needed, use that handoff note as the durable summary733. The next prompt's first action is to read its handoff note7475For **auto mode**: Codex does not expose slash-command auto mode here. Warn once and continue manually.7677## Effort Level Reference7879When the user has not specified `--effort`, suggest one based on the prompt's scope:8081- **`xhigh` / high effort** — most agentic coding: schema design, multi-file refactors, code review across a service, ambiguous debugging, multi-step agentic chains82- **`high`** — concurrent sessions, cost-sensitive agentic work where xhigh is overkill83- **`medium` / `low`** — narrow, well-specified tasks: classification, extraction, format conversion, single-file targeted fixes84- **`max`** — only for genuinely hard problems where xhigh underperforms; prone to overthinking, diminishing returns8586If a prompt's task is clearly narrow on read, prompt the user: `This looks tightly scoped. Run with --effort low to save tokens? (y/N)`.8788## Error Handling8990- If `./prompts/` directory doesn't exist: `No ./prompts/ directory found. Run /prompt to create prompts first.`91- If prompt number not found: List available prompts with numbers and names, ask which to run92- If no arguments provided: List all available prompts and ask which to run93- If a prompt fails during execution: Report the specific error, what was attempted, what succeeded before the failure, and any state-handoff notes already written. Ask whether to continue with remaining prompts.94- If `--auto` is requested: warn that Codex auto mode is unavailable in this environment and fall back to manual mode95- If `--effort` is set to a value the current model doesn't support: warn and use the closest supported level9697## After Execution9899Report concisely:100- Which prompts ran, pass/fail status, and effort level applied to each101- Files created or modified (list paths)102- Verification results (test output, lint, typecheck)103- State-handoff notes written (paths)104- Suggested next action if applicable105106For long chains, optionally wire a hook-based completion notification (sound, desktop notification) if the user asks.