I'm a teacher. My scripts send prompts to AI models through their APIs to grade work, write feedback, and build lesson materials. This Claude Code agent checks and fixes those prompts. I'm sharing it with educators who do the same.
It reviews a prompt your script sends to an AI model, or builds one from a rubric, and returns what's wrong and how to fix it:
- Grading prompts. Stops the AI from inventing quotes, or mixing up criteria by grading them all at once. Says which jobs your script should do itself (counts, bands, comparing two sources), and which need the cheap model or the bigger one.
- Feedback comments. Stops empty praise ("Great job!") and comments about things the student never wrote.
- Lesson materials. Worksheets, warm-ups, exam questions, and lesson plans that come out generic or repetitive.
- Any other prompt, on request.
It knows the quirks of Claude (Opus 5.5 and Sonnet 5.5, in API calls and in
Claude Code agents), Gemini, Gemma 4, and DeepSeek V4. Add the line
Migrate: gemini-to-ornith-1.5 to port a Gemini prompt to Ornith 1.5 9B on
Ollama; it never runs otherwise. It only reads; it never changes your files.
In Claude Code:
/plugin marketplace add dlxmax/prompt-optimizer
/plugin install prompt-optimizer
/reload-plugins
To update later: /plugin marketplace update prompt-optimizer (it reloads
plugins itself).
You don't call it yourself. Tell Claude Code which prompt, what's going wrong, and which model the script calls:
Show the grading prompt in
grade.pyto the prompt optimizer agent. It keeps inventing quotes. We're calling Gemini 3.5 Flash-Lite.
Claude sends the prompt to the agent, applies the fixes, and shows you what changed.
Every report ends with up to four lines Claude acts on:
- Input: what the request was missing (like which model the script calls) or sent that wasn't needed, so the next request is better.
- Recheck: the fixes changed the prompt's structure, so the revised version should go back for a second look.
- Compaction: the prompt carries dead weight (rules stated twice, rules for things that no longer exist, patches stacked on patches) and should be trimmed.
- Next: always there. Within 5 minutes of the report, a question about it or a revised version of the same prompt goes back to the same agent, which has already read everything, so only the new text costs full price. A different prompt, or anything later, starts a new agent.
When Recheck and Compaction both apply, they happen in one call.
Choices that change students' grades, like which way to break a tie, come back to you. It won't decide those.
Each review costs tokens. The agent runs on the same model and effort as your Claude Code session, and reads only itself and the prompt you send, not your other Claude Code settings. Claude skips rechecks when the fixes were only wording.
How it works, which file covers what, and the details for each AI model: docs/DETAILS.md.
MIT