sonmat-witness

sonmat-witness is an agent for Claude Code from jun0-ds/sonmat. It costs 47 tokens per session (6,440 once invoked), scanned A, original, BSD-3-Clause.

An independent checking agent that compares what the user asked for with what the completed work actually contains. It reports differences but does not choose the next action.

In plain words
What is it for?
Use it at commit or session-end checks to review scope and content against the user's instructions and report mismatches.
Why use it?
The agent that creates work may overlook its own misunderstandings. A separate comparison helps reveal when the result is incomplete, out of scope, or different from the request.

Agent for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: mentions subagents; mentions Claude Code.

Part of the sonmat plugin — 6 skills, 3 agents, 1 hook shipped together

Good fit Use it at commit or session-end checks to review scope and content against the user's instructions and report mismatches.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/jun0-ds/sonmat/sonmat-witness
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/jun0-ds/sonmat

Made for: Claude Code.

Or install sonmat, the plugin that ships this one along with the rest of its 6 skills, 3 agents, 1 hook.

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 sonmat-witness

README.md
[![agentmods](https://agentmods.dev/badge/agents/jun0-ds/sonmat/sonmat-witness.svg)](https://agentmods.dev/agents/jun0-ds/sonmat/sonmat-witness)
Your own site
<a href="https://agentmods.dev/agents/jun0-ds/sonmat/sonmat-witness"><img src="https://agentmods.dev/badge/agents/jun0-ds/sonmat/sonmat-witness.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,440 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.00047 $0.06440
Opus 5 $0.00023 $0.03220
Sonnet 5 $0.00009 $0.01288
Haiku 4.5 $0.00005 $0.00644

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

Security

Grade A, and why

sonmat-witness 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 8d 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.

agents/sonmat-witness.md · 333 lines

How it starts

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

Role

External witness. Your only job is to find discrepancies between what the user asked for and what the artifact actually is. You do not reason. You compare.

You are spawned by autoloop's [Judge] phase at commit decision points and at session exit (forest scope), via the Task tool. You report findings. You do not decide the next action — that belongs to main or the user. See §When witness is invoked below for the full spawn path.

You exist because the executing agent cannot reliably verify its own work. The verifier must be isolated from the executor's chain-of-thought, or it becomes a confirmation rubber-stamp. This is the same principle as aviation challenge-and-response (PM verifies the switch position, not the PF's verbal reply) and the surgical Time Out (a second person reads the checklist aloud, not the surgeon).

Two honest caveats:

  1. "Isolated" is load-bearing but weaker than the analogies suggest. See §Isolation stack for what isolation witness actually gets on current Claude Code. The execution-level layer (layer 1) is platform-enforced and real. The composition and behavioral layers (2 and 3) are aspirational contracts running on an LLM, not runtime-enforced constraints. The surgical and aviation analogies work at the organizational/physical level; witness's equivalent at the LLM level is weaker.

  2. This file is a prompt, not a compiled program. The rules you are reading — "do not reason, compare", "cite from valid sources only", "suspect first", "do not judge strength" — are instructions to the LLM that runs as witness. They are behavioral contracts, not executable constraints. A disciplined LLM following these instructions produces the witness behavior sonmat designs for; an LLM that drifts under input pressure produces something weaker. Sonmat assumes the former and should monitor for the latter; if drift is observed in practice, this agent file needs adjustment. Treat witness's verdicts as strong evidence worth citing, not as unimpeachable facts.


Read the full file on GitHub · 333 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. 8d ago First seen · 333 lines · 47 tokens per session scan A a1617ab63843

Subscribe to this mod's changes

sonmat-witness is an agent published in the GitHub repository jun0-ds/sonmat (6 stars, last pushed 10d ago), licensed BSD-3-Clause. It adds 47 tokens to every session and 6,440 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.

Related

Other agents, from other repositories

architecture-analyst

Analyzes system architecture, identifies patterns/anti-patterns, and provides strategic recommendations. Use for architectural reviews, refactoring planning, or system design decisions.

travisjneuman/.claude · 36 tokens

deep-code-reviewer

Thorough 6-aspect code review covering correctness, security, performance, maintainability, testing, and documentation. Use for comprehensive PR reviews or code quality audits.

travisjneuman/.claude · 38 tokens

security-auditor

Use when reviewing security-sensitive code paths or running OWASP / supply-chain checks. Dispatched by code-review-loop on sensitive paths (auth, payments, crypto, users, sessions, tokens). Returns findings with severity (Critical / High / Medium / Low) and OWASP category. Context: A diff touches the auth middleware.…

duthaho/claudekit · 164 tokens

code-reviewer

Use when reviewing a diff or PR for structural issues, error handling, edge cases, complexity, and style. Dispatched primarily by code-review-loop. Returns structural findings with file:line citations and ranked severity. Pairs with security-auditor for sensitive paths. Context: A PR is ready for first-pass review.…

duthaho/claudekit · 159 tokens

forge-reviewer

Reviews code against spec requirements and quality standards. Returns PASS or ISSUES with file:line references and severity levels. Dispatched after task implementation.

LucasDuys/forge · 33 tokens

structure-critic

Use this agent when you need a cross-plugin structural review — plugin.json manifest, marketplace.json entry, registry index entry, README surface tables, CHANGELOG Keep-a-Changelog discipline, and version-string sync across every source of truth (plugin.json, pyproject.toml, init.py, marketplace, registry). Adapts…

fakoli/fakoli-plugins · 696 tokens