verify-code

A command that uses Aristotle to check whether an algorithm satisfies a written specification. It organizes the code with assumptions about inputs, the implementation, expected results, and a theorem to prove.

In plain words
What is it for?
Use it to verify an algorithm, find bugs, and check whether its input and output requirements are stated correctly, using Lean 4 code.
Why use it?
It can expose incorrect algorithms by finding counterexamples or show that the stated conditions hold. This is formal verification, meaning correctness is checked with machine-checked proofs rather than only example tests.

Command

Part of the aristotle plugin — 1 skill, 2 commands, 2 agents shipped together

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/afhverjuekki/claude-code-aristotle-plugin/verify-code
Clone the repo
git clone --depth 1 https://github.com/afhverjuekki/claude-code-aristotle-plugin

Or install aristotle, the plugin that ships this one along with the rest of its 1 skill, 2 commands, 2 agents.

Per session 18 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,230 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.00018 $0.01230
Opus 5 $0.00009 $0.00615
Sonnet 5 $0.00004 $0.00246
Haiku 4.5 $0.00002 $0.00123

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

Security

Grade A, and why

verify-code 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 3d 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.

commands/verify-code.md · 155 lines

How it starts

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

Aristotle Code Verification

Load the aristotle-workflow skill for comprehensive guidance.

Overview

Aristotle achieved 96.8% accuracy on the VERINA benchmark, proving algorithm correctness and finding bugs in implementations. Use this command to:

  1. Verify algorithm correctness - Prove implementations meet specifications
  2. Find bugs - Discover counterexamples when code is incorrect
  3. Validate specifications - Check if pre/postconditions are correctly stated

VERINA-Style Verification Structure

Code verification in Lean 4 uses four components:

-- 1. PRECONDITION: Assumed to hold before execution
def myAlgorithm_precond (input : Type) : Prop :=
  -- conditions on input

-- 2. ALGORITHM: The implementation to verify
def myAlgorithm (input : Type) (h_precond : myAlgorithm_precond input) : OutputType :=
  -- implementation

-- 3. POSTCONDITION: Must hold after execution
def myAlgorithm_postcond (input : Type) (result : OutputType)
    (h_precond : myAlgorithm_precond input) : Prop :=
  -- conditions on result given input

-- 4. SPECIFICATION THEOREM: The verification goal
theorem myAlgorithm_spec_satisfied (input : Type)
    (h_precond : myAlgorithm_precond input) :
    myAlgorithm_postcond input (myAlgorithm input h_precond) h_precond := by
  sorry

If Given a Lean File ($ARGUMENTS)

  1. Read the file: @$1

  2. Identify the verification structure:

    • Preconditions (_precond)
    • Algorithm implementation
    • Postconditions (_postcond)
    • Specification theorems (_spec_satisfied)
  3. Check for missing components and help complete them

  4. Submit to Aristotle:

uvx --from aristotlelib aristotle prove-from-file "$1" \
  --no-validate-lean-project --no-auto-add-imports
  1. Interpret results:
    • Proof found: Algorithm is correct
    • Counterexample found: Implementation has a bug OR specification is wrong
    • False detected: Aristotle proves the negation with concrete values

If Given an Algorithm Description

Read the full file on GitHub · 155 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. 3d ago First seen · 155 lines · 18 tokens per session scan A 06be99f47808

Subscribe to this mod's changes

verify-code is a command published in the GitHub repository afhverjuekki/claude-code-aristotle-plugin (10 stars, last pushed 7mo ago), licensed MIT. It adds 18 tokens to every session and 1,230 once invoked, about $0.0001 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.