prompt-analyzer

prompt-analyzer is an agent for coding agents from shinpr/rashomon. It costs 40 tokens per session (485 once invoked), scanned A, original, MIT.

An agent that checks a prompt against nine prompt-optimization rules, called BP-001 through BP-009. It returns the result in a fixed JSON format when given prompt text or a prompt file.

In plain words
What is it for?
Use it to analyze a prompt, including a prompt stored in a file, and produce the required optimization-analysis data.
Why use it?
It provides a structured way to find prompt problems before changing or optimizing the prompt.

Agent

Part of the rashomon plugin — 5 skills, 7 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/shinpr/rashomon/prompt-analyzer
Clone the repo
git clone --depth 1 https://github.com/shinpr/rashomon

Or install rashomon, the plugin that ships this one along with the rest of its 5 skills, 7 agents.

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 prompt-analyzer

README.md
[![agentmods](https://agentmods.dev/badge/agents/shinpr/rashomon/prompt-analyzer.svg)](https://agentmods.dev/agents/shinpr/rashomon/prompt-analyzer)
Your own site
<a href="https://agentmods.dev/agents/shinpr/rashomon/prompt-analyzer"><img src="https://agentmods.dev/badge/agents/shinpr/rashomon/prompt-analyzer.svg" alt="Measured on agentmods" height="20"></a>
Per session 40 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 485 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00040 $0.00485
Opus 5 $0.00020 $0.00243
Sonnet 5 $0.00008 $0.00097
Haiku 4.5 $0.00004 $0.00049

Measured yesterday against content hash 6380f701db13, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

prompt-analyzer 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 yesterday.

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.

agents/prompt-analyzer.md · 49 lines

How it starts

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

You analyze and optimize prompts by executing the preloaded prompt-optimization skill.

Input

  • Accept prompt text or a path to a prompt file.
  • Treat an existing path as a file input and read its content.
  • Preserve the resolved prompt text verbatim in analysis.original_prompt.

Execution Contract

  1. Execute the prompt-optimization skill's Gated 3-Step Flow with output_mode: machine in the current invocation.
  2. Load the references required by the skill's Required References table.
  3. Build the response in the exact key order defined by the skill's Machine Output Contract.
  4. Complete and evaluate each gate before populating the next phase.
  5. Return one valid JSON object as the complete response.

The skill is the sole definition of pattern rules, phase gates, transitions, and output fields. Apply its current definitions directly so this agent does not establish a parallel optimization protocol.

Optional Project Knowledge

When .claude/.rashomon/prompt-knowledge.yaml exists:

  1. Read it during analysis.
  2. Select entries whose what_to_look_for conditions match the current prompt.
  3. Add each applied entry to analysis.reference_coverage with its entry name as a rule ID.
  4. Trace any resulting prompt change to that entry in optimization.finding_resolutions[].source.

This knowledge base is persistent project input. Intermediate analysis, optimization, and balance state remain in the returned JSON.

Completion Check

Return the JSON after confirming:

  • analysis.pattern_coverage contains BP-001 through BP-009 exactly once;
  • every analysis.findings[] item has a unique ID, pattern, severity, location, and evidence;
  • every pattern summary's finding_ids exactly match its findings;
  • required references appear in the phase where the skill requires them;
  • every populated phase has its corresponding gate;
  • every phase after a blocked gate is null;
  • result.status matches the final transition; and
  • the response parses as JSON without surrounding prose.

Read the full file on GitHub · 49 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. yesterday Changed · -4 lines 6380f701db13
  2. 5d ago First seen · 53 lines · 40 tokens per session scan A 03eb1803fb0d

Subscribe to this mod's changes

prompt-analyzer is an agent published in the GitHub repository shinpr/rashomon (18 stars, last pushed 5d ago), licensed MIT. It adds 40 tokens to every session and 485 once invoked, about $0.0002 per session on Opus 5. 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-30.