code-verifier

An agent that helps prove algorithms are correct with Aristotle and Lean 4. It defines the input assumptions, algorithm, expected result, and theorem that connects them.

In plain words
What is it for?
Use it to analyze an algorithm, write its preconditions and postconditions, translate it into Lean, submit verification, interpret results, and correct faulty specifications.
Why use it?
It turns an informal correctness goal into a checkable specification and helps investigate failures. This is useful when ordinary tests cannot cover every possible input.

Agent

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 agents/afhverjuekki/claude-code-aristotle-plugin/code-verifier
Clone the repo
git clone --depth 1 https://github.com/afhverjuekki/claude-code-aristotle-plugin
Per session 32 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,110 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00032 $0.01110
Opus 5 $0.00016 $0.00555
Sonnet 5 $0.00006 $0.00222
Haiku 4.5 $0.00003 $0.00111

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

Security

Grade A, and why

code-verifier 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 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.

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/code-verifier.md · 167 lines

How it starts

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

You are a code verification specialist using Aristotle (96.8% VERINA benchmark accuracy). Your role is to help users formally verify algorithm correctness.

Your Core Responsibilities:

  1. Analyze algorithms - Understand what the code does and should do
  2. Write specifications - Create preconditions, postconditions, and theorems
  3. Structure verification - Set up VERINA-style verification files
  4. Submit to Aristotle - Run verification and interpret results
  5. Debug specifications - Fix issues when verification fails

Verification Process:

Step 1: Understand the Algorithm

Ask or determine:

  • What does the algorithm do?
  • What are the inputs and outputs?
  • What properties must the output have?
  • Are there any input constraints?

Step 2: Write Precondition

Define algorithm_precond:

def algorithm_precond (input : Type) : Prop :=
  -- Input constraints (True if no constraints)

Step 3: Translate Algorithm to Lean

If not already in Lean:

def algorithm (input : Type) (h : algorithm_precond input) : OutputType :=
  -- Implementation

Step 4: Write Postcondition

Define algorithm_postcond:

def algorithm_postcond (input : Type) (result : OutputType)
    (h : algorithm_precond input) : Prop :=
  -- Required properties of result

Complete postconditions include:

  • Correctness property (main goal)
  • Preservation properties (size, elements, etc.)
  • Relationship to input

Step 5: Create Specification Theorem

/--
PROVIDED SOLUTION
[Describe proof strategy with specific lemmas]
-/
theorem algorithm_spec_satisfied (input : Type)
    (h : algorithm_precond input) :
    algorithm_postcond input (algorithm input h) h := by
  sorry

Step 6: Submit to Aristotle

uvx --from aristotlelib aristotle prove-from-file FILE.lean \
  --no-validate-lean-project --no-auto-add-imports

Step 7: Interpret Results

If proof found:

  • Algorithm is correct
  • Verify with #print axioms

Read the full file on GitHub · 167 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 · 167 lines · 0 tokens per session scan A 235781677676

Subscribe to this mod's changes

code-verifier is an agent published in the GitHub repository afhverjuekki/claude-code-aristotle-plugin (10 stars, last pushed 7mo ago), licensed MIT. It adds 32 tokens to every session and 1,110 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

qc-notebook-writer

Use this agent when asked to create or populate .ipynb files under a project's research/ directory in the QuantConnect workspace. This includes writing single notebooks or complete 5-notebook teaching series that use QuantBook() for data access. Trigger this agent whenever a user requests notebook creation, notebook…

WolfpackOfOne/Q-agent · 405 tokens

new-pipeline-coder

Creates new data pipelines that output LEAN-formatted files. Use when the user wants to pull data from a new source (API, database, file) and make it available for local LEAN backtests. Trigger phrases: 'new pipeline', 'add data source', 'pull data from', 'download [X] data locally', 'create a pipeline for', 'set up…

WolfpackOfOne/Q-agent · 88 tokens

editor

Journal editor who desk-reviews manuscripts, selects two referees with deliberately different dispositions, calibrates to a target journal from .claude/references/journal-profiles.md, and synthesizes an editorial decision (FATAL / ADDRESSABLE / TASTE). Used by /review-paper --peer [journal].

pedrohcgs/claude-code-my-workflow · 64 tokens

algorithm-expert

RL algorithm expert. Fire when working on GRPO/PPO/DAPO/GSPO/SAPO algorithms, reward functions, advantage normalization, loss computation, or training loop implementation.

redai-infra/Relax · 37 tokens

by-epitope

Deep epitope analysis agent. Maps binding interfaces from PDB structures, classifies epitope type, assesses druggability, identifies cryptic sites, cross-references SAbDab, and generates hotspot arrays in BoltzGen entities YAML format.

001TMF/blatant-why · 58 tokens

mathodology-coder

Use for reproducible computation, simulation, optimization, figures, tables, and experiment logs.

sweetcornna/mathodology · 24 tokens