ScalaSemantic: Agent for Claude Code

.claude/agents/sanity-check.md

sanity-check is an agent for Claude Code from MercurieVV/ScalaSemantic. It costs 69 tokens per session (386 once invoked), scanned A, original, MIT.

A pre-commit check that looks at an agent's code changes for unrelated files, generated clutter, secrets, and other unwanted additions.

In plain words
What is it for?
Use it to inspect a task agent's worktree and return a small pass-or-fail report about scope and repository cleanliness.
Why use it?
It catches accidental or unsafe changes before they are committed, without attempting to judge whether the code works correctly.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is MercurieVV/ScalaSemantic's own configuration. It tells Claude Code how to work on ScalaSemantic itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ScalaSemantic configures →

Reuse

Borrowing it

Nothing to install: this file belongs to MercurieVV/ScalaSemantic. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/MercurieVV/ScalaSemantic/master/.claude/agents/sanity-check.md
Clone the repo
git clone --depth 1 https://github.com/MercurieVV/ScalaSemantic

Made for: Claude Code.

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 sanity-check

README.md
[![agentmods](https://agentmods.dev/badge/agents/mercurievv/scalasemantic/sanity-check/github.svg)](https://agentmods.dev/agents/mercurievv/scalasemantic/sanity-check)
Your own site
<a href="https://agentmods.dev/agents/mercurievv/scalasemantic/sanity-check"><img src="https://agentmods.dev/badge/agents/mercurievv/scalasemantic/sanity-check/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sanity-check

Your own site · 80×15
<a href="https://agentmods.dev/agents/mercurievv/scalasemantic/sanity-check"><img src="https://agentmods.dev/badge/agents/mercurievv/scalasemantic/sanity-check.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 386 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.00069 $0.00386
Opus 5 $0.00034 $0.00193
Sonnet 5 $0.00014 $0.00077
Haiku 4.5 $0.00007 $0.00039

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

Security

Grade A, and why

sanity-check 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 11d 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/agents/sanity-check.md · 23 lines

What it actually says

You are the cheap pre-commit gate called by a task agent on its OWN worktree. You do NOT review code quality or correctness (build/test hooks own that). You only catch JUNK and SCOPE CREEP.

Input: a worktree path and the task's expected touched_areas.

Steps (stop as soon as you can decide):

  1. scripts/worktree-diff.sh <wt> — ONE call returns the cheap signal (porcelain status + per-file stat + large-file flags). Read filenames + sizes only.
  2. FAIL if you see: new files outside the expected touched_areas; build artifacts or scratch (target/, .bsp/, *.log, *.tmp, node_modules/, editor/OS cruft, *.class, dumps); anything that looks like a secret/credential; suspiciously large additions; edits to files unrelated to the task.
  3. Only if a specific file looks borderline, read just that file (or git diff for it) to judge. Do not read the whole diff by default.

Output ONLY this JSON:

{ "verdict": "pass|fail", "offending": ["path …"], "reason": "<one short line>" }

pass with empty offending when the change is scoped and clean. Be strict about junk, lenient about legitimate in-scope edits. Keep it to the minimum tool calls needed.

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. 11d ago First seen · 23 lines · 69 tokens per session scan A bbddb3edb762

Subscribe to this mod's changes

sanity-check is an agent published in the GitHub repository MercurieVV/ScalaSemantic (21 stars, last pushed today), licensed MIT. It adds 69 tokens to every session and 386 once invoked, about $0.0003 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.

Related

Other agents, from other repositories

php-reviewer

PHP 8.5 and Clean Architecture code review specialist — DDD, hexagonal, PSR-12, PHPStan, security analysis.

TheBeardedBearSAS/claude-craft · 32 tokens

code-review

Multi-persona orchestrator for adversarial review of R, Python, Julia, or Stata research scripts. Runs an 11-category baseline checklist, then dispatches 3-6 specialist sub-agents (correctness, reproducibility, design, plus optional domain / performance / security) in parallel. Deduplicates findings across reviewers…

flonat/flonat-research · 398 tokens

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

ia-database-guardian

Reviews database schema, constraints, and migration code for safety. Use when PRs touch migrations, data models, ID mappings, enum conversions, backfills, or persistent data.

iliaal/whetstone · 41 tokens

review-rails

Rails conventions and architecture reviewer for PR audits. Spawned by /rpi:review-pr as subagenttype rpi:review-rails with artifact paths. Ensures existing framework features are used, not reinvented — reads changed files in full and compares them against siblings and the framework-native form.

hoblin/claude-ruby-marketplace · 64 tokens

ia-best-practices-researcher

Researches external framework docs, version-specific constraints, and industry conventions for any technology. Use when you need authoritative external documentation.

iliaal/whetstone · 34 tokens