sw-eval

A command that runs the Specwright evaluation suite by starting subagents in test workspaces and grading their results. An evaluation suite is a set of repeatable tests for checking agent behavior.

In plain words
What is it for?
Running all skill evaluations, one selected case, integration evaluations, or a dry run that only lists available cases.
Why use it?
It helps measure whether skills and integrations produce the expected results before relying on them.

Command for Claude Code

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 commands/obsidian-owl/specwright/sw-eval
Clone the repo
git clone --depth 1 https://github.com/Obsidian-Owl/specwright

Made for: Claude Code.

Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 882 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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 $0.00022 $0.00882
Opus 5 $0.00011 $0.00441
Sonnet 5 $0.00004 $0.00176
Haiku 4.5 $0.00002 $0.00088

Measured 2d ago against content hash e40fa13a3f0a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

sw-eval scanned grade C with 1 finding 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 2d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf <WORKDIR>
.claude/commands/sw-eval.md · 128 lines

How it starts

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

Specwright Eval Runner

Run eval cases by spawning subagents for skill invocation, then grading the results.

Usage

/sw-eval --suite skill                    # Run all skill evals
/sw-eval --suite skill --case sw-init-fresh-ts  # Run one case
/sw-eval --suite skill --dry-run          # List cases without running
/sw-eval --suite integration              # Run integration evals

Instructions

Parse the arguments from the command input. The arguments follow the patterns above.

Step 1: Load the eval suite

Run this to load and validate the eval suite (output goes to stderr):

python -m evals --suite <SUITE_NAME> --dry-run 2>&1

This prints each eval case ID and its fixture path. If --dry-run was requested, stop here and show the output.

If --case was specified, filter to only that case from the output.

Step 1b: Create results directory

Create a timestamped results directory:

python -c "
import os
from datetime import datetime, timezone
ts = datetime.now(timezone.utc).strftime('%Y%m%dT%H%M%S')
results_dir = os.path.join('evals', 'results', f'run-{ts}')
os.makedirs(results_dir, exist_ok=True)
print(results_dir)
"

Save this as RESULTS_DIR for all subsequent steps.

Step 2: For each eval case

For each eval case (from the dry-run output), do the following:

2a. Setup fixture

Copy the fixture to a temp working directory using Bash:

python -c "
import shutil, tempfile, os
fixture_path = os.path.join(os.path.dirname(os.path.abspath('evals/__init__.py')), 'evals', '<FIXTURE_PATH_FROM_DRY_RUN>')
workdir = tempfile.mkdtemp(prefix='eval-')
shutil.copytree(fixture_path, workdir, dirs_exist_ok=True)
print(workdir)
"

Save the workdir path for the next steps.

2b. Run the skill via subagent

Spawn a subagent using the Agent tool:

Agent(
  prompt="<THE EVAL PROMPT - resolve from evals.json prompt_template + prompt_args>

Work in this directory: <WORKDIR>
Change to this directory first, then perform the task.
Accept all defaults. Do not ask clarifying questions.",
  subagent_type="general-purpose",
  description="Eval: <EVAL_ID>"
)

Read the full file on GitHub · 128 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. 2d ago First seen · 128 lines · 22 tokens per session scan C e40fa13a3f0a

Subscribe to this mod's changes

sw-eval is a command published in the GitHub repository Obsidian-Owl/specwright (9 stars, last pushed 4mo ago), licensed MIT. It adds 22 tokens to every session and 882 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.