mcp-prompt-optimizer: Command for Claude Code

.claude/commands/ori.md

ori is a command for Claude Code from grandinh/mcp-prompt-optimizer. It costs 0 tokens per session (4,457 once invoked), scanned A, original, MIT.

A command that runs a multi-stage workflow for researching, checking, implementing, and documenting a change, with model selection for each stage.

In plain words
What is it for?
Use it to plan a change, research the relevant information, verify findings, implement the code, and update documentation.
Why use it?
It organizes work that would otherwise require you to coordinate investigation, validation, coding, and documentation manually.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: positional $N argument.

This is grandinh/mcp-prompt-optimizer's own configuration. It tells Claude Code how to work on mcp-prompt-optimizer itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-prompt-optimizer configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/grandinharrison/prompts/optimized_prompts.md.

Reuse

Borrowing it

Nothing to install: this file belongs to grandinh/mcp-prompt-optimizer. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/grandinh/mcp-prompt-optimizer/main/.claude/commands/ori.md
Clone the repo
git clone --depth 1 https://github.com/grandinh/mcp-prompt-optimizer

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ori

README.md
[![agentmods](https://agentmods.dev/badge/commands/grandinh/mcp-prompt-optimizer/ori/github.svg)](https://agentmods.dev/commands/grandinh/mcp-prompt-optimizer/ori)
Your own site
<a href="https://agentmods.dev/commands/grandinh/mcp-prompt-optimizer/ori"><img src="https://agentmods.dev/badge/commands/grandinh/mcp-prompt-optimizer/ori/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ori

Your own site · 80×15
<a href="https://agentmods.dev/commands/grandinh/mcp-prompt-optimizer/ori"><img src="https://agentmods.dev/badge/commands/grandinh/mcp-prompt-optimizer/ori.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,457 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.04457
Opus 5 $0.00000 $0.02228
Sonnet 5 $0.00000 $0.00891
Haiku 4.5 $0.00000 $0.00446

Measured 10d ago against content hash 05ad13386713, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

ori scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/ori.md · 627 lines

How it starts

The opening of the file, as written. The whole thing — 627 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Optimize Research Implement (ORI) Workflow

Version: 1.1 Purpose: Autonomous multi-phase workflow with intelligent model selection for researching, validating, and implementing changes with minimal user input.


Workflow Overview

Execute the following phases sequentially with built-in error handling, validation, and intelligent model selection:

PHASE 0: STRATEGY (Opus) → PHASE 1: RESEARCH (Dynamic) → PHASE 2: VERIFY (Sonnet) → PHASE 3: IMPLEMENT (Sonnet/Haiku) → PHASE 4: DOCUMENT (Haiku)

Model Selection Strategy

Per-Phase Model Recommendations

The workflow uses different models optimized for each phase:

Phase Recommended Model Rationale
Phase 0: Strategy Opus Complex reasoning, strategic planning, research design
Phase 1: Research Dynamic Opus decides based on complexity; Sonnet for standard, Opus for complex
Phase 2: Verify Sonnet Balance of speed and accuracy for validation
Phase 3: Implement Sonnet/Haiku Sonnet for complex code, Haiku for simple edits
Phase 4: Document Haiku Fast, cost-effective for doc updates

When to Use Each Model

Opus (claude-opus-4):

  • Strategic planning and research design
  • Complex multi-step reasoning
  • Novel or ambiguous problems
  • High-stakes decisions requiring deep analysis
  • Architectural decisions

Sonnet (claude-sonnet-4-5):

  • Most implementation tasks
  • Code generation and refactoring
  • Validation and verification
  • Balanced performance/cost for general tasks

Haiku (claude-haiku-4):

  • Simple file edits
  • Documentation updates
  • Formatting and style fixes
  • Quick, straightforward tasks

Phase 0: Research Strategy (STRATEGIC PLANNING)

Objective

Use Opus to create an optimal research strategy and select the best model for execution.

Model: Opus (claude-opus-4)

Instructions

IMPORTANT: This phase MUST use Opus via the Task tool:

Read the full file on GitHub · 627 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 627 lines · 0 tokens per session scan A 05ad13386713

Subscribe to this mod's changes

ori is a command published in the GitHub repository grandinh/mcp-prompt-optimizer (0 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 4,457 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.