/verity:provefrom Verity by Codacy
Formally verifies small, risky code snippets using Lean 4 models via the Verity service. Ranks candidates from git history, confirms with user, generates a model, checks locally, and replays counterexamples on real code.
Ships in Verity by Codacy. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The words after /verity:prove are the hint. /verity:prove alone means "find me
something worth checking"; /verity:prove can the Stripe webhook double-charge on a redelivered event? names the target and the worry. Carry it through every step as
$ARGUMENTS.
Verity keeps Lean 4 models of the riskiest code, not of the codebase: a few dozen lines that abstract ONE function and check a few properties by exhaustive bounded search. When a property fails you get the shortest sequence of actions that breaks it — a hypothesis to replay on the real code.
The service does the work; you orchestrate and present. Ranking, writing the model and replaying its counterexample all run on the Verity service through the CLI. You do not search the codebase by hand, read the Lean library, or write Lean yourself unless a step below says so. Each step is one command; read its output, decide, move on. Lean runs on this machine only because the user asked for it; nothing here blocks a commit or a push.
verity prove candidates --limit 8 --json # no hint
verity prove candidates --hint - --json <<'VERITY_EOF_<random>'
<the hint>
VERITY_EOF_<random>
The hint is the user's words, so it goes through the quoted heredoc (- means
stdin), never inside "…" on the command line, where a ", a backtick or $(…)
in it would run in the shell. The quotes around the first VERITY_EOF_<random>
stop the shell expanding anything. Replace <random> with 8 random letters and
digits that you pick for this call, the same at both ends. Text written before you
picked them cannot contain the line that ends the heredoc, so it cannot end it early.
The hint widens the pool (files it names by path or content come first) and the service ranks it, naming a symbol and the properties worth checking per file. Do not search for the code yourself: if the ranker's list does not contain what the user meant, say so and ask them for the file or function. A named file or function in the hint skips ranking: go straight to step 2 with it.
Do not generate a model until the user has said which code. Present at most three
candidates in one short message: file, the symbol the ranker named, the first property
it suggested, the reason. Ask. Their answer is the scope; do not widen it. If the hint
is a worry in the user's words, it becomes an intent property — that needs no further
confirmation, they just gave it.
A hint that names the code, or a candidate the user saw in an earlier session, is
not a confirmation of the exact symbol and property. Still ask, in one line:
"I'll model <file>#<symbol> for <property> — go ahead?" It costs the user one word.
verity prove init
If Lean is missing, say what will be installed and where before running
verity lean install (official release, ≈800 MB download, 2.7 GB on disk, into
~/.verity/lean). Everything else needs only verity login.
verity prove generate src/pay.ts#charge --hint - <<'VERITY_EOF_<random>'
<the hint>
VERITY_EOF_<random>
# a region:
verity prove generate src/handler.ts --lines 120-180 --hint - <<'VERITY_EOF_<random>'
<the hint>
VERITY_EOF_<random>
Leave out --hint - and the heredoc when there is no hint. Pick new letters for
<random> on each call.
The service writes the model, the linter fences it, this machine elaborates it, with
up to 3 rounds on compiler errors — all inside the command. It prints the check:
per property ✓ holds to bound k, ✗ COUNTEREXAMPLE with the trace, or ? inconclusive.
Only if it ends with "no model elaborated" do you write one by hand from
.verity/proofs/Models/README.md (one symbol, ≤ ~120 lines, #eval Verity.model …
header, one #eval Verity.check … per property, tagged .structural or .intent with
source :=); check it with verity prove check <Name>.
verity prove replay <Name> # every counterexample
verity prove replay <Name> --property P2 # one
The service replays the trace on the real code in a network-less container and accepts
an answer only when code ran, the real function's lines appear verbatim in the harness,
and the harness itself printed REPLAY_RESULT=reproduced. A model's counterexamples
replay in parallel, so the command takes about as long as one replay (~30 s). Run it
in the foreground and wait for it: do not background it, do other work, or report
before every verdict is in. Read the verdict:
<symbol>" —
that is a valid result, not a bug.The revise command. The note goes through the heredoc, as the hint does:
verity prove generate <target> --revise <Name> --note - <<'VERITY_EOF_<random>'
<what the replay showed>
VERITY_EOF_<random>
Never weaken or delete a property to get green; never add one to make something fail.
What was modelled, what was checked to what bound, what was refuted and whether it
replayed, and what remains intent awaiting the user's confirmation. Never offer to
commit the model — .verity/proofs/ is machine-local and ignores itself. What reaches
the team is the bug report and, when asked, the fix. Then record the outcome:
verity reflect --user-input - --kind gotcha <<'VERITY_EOF_<random>'
Modelled runSeed (cli/src/lib/seed-runner.ts): P1 at-most-once refuted in 2 steps, replayed — guard checks a path the server never writes.
VERITY_EOF_<random>
The abstracted file's content leaves the machine for the Verity service and its replay container; only git-tracked files are ever read.
verity prove generate can still try.verity prove replay, or report before its verdicts are in.sorry in a model, weaken a property to get green, or touch source files..verity/proofs/.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
formal-verification, lean4, model-checking, verity, bug-detection
npx claudepluginhub codacy/verity --plugin verity11 skills in this plugin
/analyze/verity:analyze — Run Verity analysis on demandRun an independent AI review of the current change on demand — a second opinion on quality, security, and whether the code matches its stated intent. Use when the user asks to review, check, or analyze code before committing, or to get an independent check on work you have just finished./feedback/verity:feedback — Send feedbackSend the user's feedback about Verity to the Verity team, verbatim. Use only when the user explicitly asks to send feedback./init/verity:init — set Verity up in this projectSet Verity up in this project: ask the setup questions in the session (sign in, and the Standard: use the team's, or write project rules from a repo profile), sign in, and run the install with those answers. Use right after installing the Verity plugin, or when Verity says this project is not set up./insights/verity:insights — Project quality insights and Standard evolutionReport project quality metrics from accumulated run data, and manage the Standard's evolution suggestions. Use when the user asks for quality trends or metrics, or whether the Standard should change./learn/verity:learn — View and manage project knowledgeView and manage the durable project knowledge Verity has accumulated — decisions, patterns, gotchas, and conventions extracted from past analysis runs. Use when the user asks what Verity has learned, or before changing an area of the code you do not know./memory/verity:memory — Manage the project knowledge graphBrowse, query, and extend the project knowledge graph at .verity/memory/ — typed nodes and edges covering decisions, patterns, security constraints, and gotchas. Use to pull prior context on files you are about to change, or when the user asks to record or inspect project knowledge.