self-eval

self-eval is a command for Claude Code from ShaheerKhawaja/ProductionOS. It costs 43 tokens per session (1,229 once invoked), scanned A, original, MIT.

A self-review command that evaluates recent work or a selected change for quality, necessity, correctness, dependencies, completeness, learning, and honesty.

In plain words
What is it for?
Evaluating the latest agent output, a session’s work, the current uncommitted changes, or a specified file.
Why use it?
It creates a deliberate quality check instead of relying only on the person or agent that produced the work.

Command for Claude Code

Written for Claude Code: arguments in frontmatter.

Part of the productionos plugin — 4 skills, 41 commands, 11 agents shipped together

Good fit Evaluating the latest agent output, a session’s work, the current uncommitted changes…

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/shaheerkhawaja/productionos/self-eval
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.

Clone the repo
git clone --depth 1 https://github.com/ShaheerKhawaja/ProductionOS

Made for: Claude Code.

Or install productionos, the plugin that ships this one along with the rest of its 4 skills, 41 commands, 11 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 self-eval

README.md
[![agentmods](https://agentmods.dev/badge/commands/shaheerkhawaja/productionos/self-eval.svg)](https://agentmods.dev/commands/shaheerkhawaja/productionos/self-eval)
Your own site
<a href="https://agentmods.dev/commands/shaheerkhawaja/productionos/self-eval"><img src="https://agentmods.dev/badge/commands/shaheerkhawaja/productionos/self-eval.svg" alt="Measured on agentmods" height="20"></a>
Per session 43 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,229 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.00043 $0.01229
Opus 5 $0.00022 $0.00615
Sonnet 5 $0.00009 $0.00246
Haiku 4.5 $0.00004 $0.00123

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

Security

Grade A, and why

self-eval 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 6d 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/self-eval.md · 159 lines

How it starts

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

/self-eval — Self-Evaluation Command

You are the self-evaluation orchestrator. You evaluate the quality, necessity, and correctness of recent work using the ProductionOS Self-Eval Protocol.

Step 0: Preamble

Before executing, run the shared ProductionOS preamble (templates/PREAMBLE.md).

Step 1: Determine Evaluation Target

Based on $ARGUMENTS.target:

target = "last"

# Find the most recent agent output
ls -t .productionos/*.md .productionos/**/*.md 2>/dev/null | head -5

Read the most recent artifact. This is your evaluation target.

target = "session"

# Find all work done this session
ls -t .productionos/self-eval/ 2>/dev/null | head -20
git log --oneline --since="4 hours ago" 2>/dev/null | head -20
git diff --stat HEAD~10 2>/dev/null | tail -5

Evaluate ALL work produced this session. Produce a session-level summary.

target = "diff"

# Evaluate the current git diff
git diff --stat 2>/dev/null
git diff --name-only 2>/dev/null

Evaluate all uncommitted changes against the self-eval protocol.

target = specific path

Read the specified file and evaluate it.

Step 2: Dispatch Self-Evaluator Agent

Read agents/self-evaluator.md and dispatch:

Agent tool:
  description: "self-evaluator: Evaluate {target description}"
  prompt: "{self-evaluator role + instructions}\n\nTASK: Evaluate {target}\nDEPTH: $ARGUMENTS.depth\nOUTPUT: .productionos/self-eval/{timestamp}-eval.md"

Step 3: Process Results

Read the evaluation output. Based on score:

Score >= 8.0 — PASS

✅ Self-Eval PASS (X.X/10)
{summary of findings}
Logged to .productionos/self-eval/{file}

Score 6.0-7.9 — CONDITIONAL (self-heal if enabled)

If $ARGUMENTS.heal is "on":

  1. Read the lowest-scoring questions
  2. Generate targeted fix instructions
  3. Dispatch the original agent (or self-healer) to address issues
  4. Re-run self-eval (max 3 loops)
  5. Report final result

If $ARGUMENTS.heal is "off":

⚠️ Self-Eval CONDITIONAL (X.X/10)
{issues that need attention}
Run /self-eval --heal on to attempt self-fix

Read the full file on GitHub · 159 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. 6d ago First seen · 159 lines · 43 tokens per session scan A da1165908eca

Subscribe to this mod's changes

self-eval is a command published in the GitHub repository ShaheerKhawaja/ProductionOS (8 stars, last pushed 4mo ago), licensed MIT. It adds 43 tokens to every session and 1,229 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-31.