polyviz

polyviz is a command for Claude Code from cognitive-fab/polygraph. It costs 64 tokens per session (790 once invoked), scanned A, original, Apache-2.0.

A command that turns Polygraph and polyvers verification artifacts into fixed diagrams. Polygraph artifacts describe checked state-machine behavior, while polyvers artifacts describe compatibility checks between versions.

In plain words
What is it for?
Use it to render state-machine, invariant, counterexample, compatibility-gate, or model-card diagrams from a JSON visualization model or an artifacts directory, in SVG or optionally PNG.
Why use it?
It provides a readable view of verification data without rerunning verification or relying on a model. The output is deterministic, so the same input produces the same diagram.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the polyviz plugin — 1 skill, 1 command, 1 agent shipped together

Good fit Use it to render state-machine, invariant, counterexample, compatibility-gate, or model-card diagrams from a JSON visualization model or an artifacts directory, in SVG or optionally PNG.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add cognitive-fab/polygraph
Claude Code
/plugin install polyviz

Made for: Claude Code.

Or install polyviz, the plugin that ships this one along with the rest of its 1 skill, 1 command, 1 agent.

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 polyviz

README.md
[![agentmods](https://agentmods.dev/badge/commands/cognitive-fab/polygraph/polyviz/github.svg)](https://agentmods.dev/commands/cognitive-fab/polygraph/polyviz)
Your own site
<a href="https://agentmods.dev/commands/cognitive-fab/polygraph/polyviz"><img src="https://agentmods.dev/badge/commands/cognitive-fab/polygraph/polyviz/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 polyviz

Your own site · 80×15
<a href="https://agentmods.dev/commands/cognitive-fab/polygraph/polyviz"><img src="https://agentmods.dev/badge/commands/cognitive-fab/polygraph/polyviz.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 64 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 790 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.00064 $0.00790
Opus 5.5 $0.00026 $0.00316
Sonnet 5.5 $0.00013 $0.00158
Haiku 4.5 $0.00006 $0.00079

Measured 1mo ago against content hash f23e9f9e2363, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

polyviz 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 1mo 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.

polyviz/commands/polyviz.md · 51 lines

What it actually says

Run polyviz over the arguments in $ARGUMENTS. polyviz is the VISUALIZATION side of the method: it turns the artifacts Polygraph/polyvers already produced into a fixed catalog of clean, brand-consistent diagrams. Rendering is a pure function artifacts → SVG — deterministic (byte-identical on repeat), no model call, no network. It does not run verification; it only visualizes.

This drives ${CLAUDE_PLUGIN_ROOT}/bin/polyviz.mjs:

node ${CLAUDE_PLUGIN_ROOT}/bin/polyviz.mjs render --in <dir|polyviz.json> \
    --diagram <all|state-machine|invariants|counterexample|compat-gate|model-card> \
    --out <dir> [--format svg,png] [--theme dark|light] [--tokens f.json] [--scale 2]
node ${CLAUDE_PLUGIN_ROOT}/bin/polyviz.mjs hash --in <...> --diagram <...>
node ${CLAUDE_PLUGIN_ROOT}/bin/polyviz.mjs schema

Inputs:

  • A viz-model JSON (*.polyviz.json, the stable contract — polyviz schema prints it): pure viz-model → SVG, executes no user code, no optional deps for SVG.
  • A Polygraph/polyvers artifacts directory: adapters derive the machine graph (bounded BFS that executes the SAM/next module), read invariants.mjs, resolve a failing findings.json to its counterexample trace, and map compat-report.json. A polyviz.annotations.json in the dir supplies the narrative the raw artifacts don't carry.

Optional runtime components (mention when relevant): state-machine/model-card need elkjs; --format png needs @resvg/resvg-js (native/WASM). The SVG path for invariants/counterexample/compat-gate needs neither. Missing optional deps fail loud with the exact npm i to run.

Workflow:

  1. Default to --format svg (deterministic, diffable). Add png only for a raster deliverable.
  2. When --in is a run directory, warn that the machine graph is derived by executing the module, and offer a polyviz.annotations.json for nicer copy.
  3. Branding (footer wordmark + tagline, default COGNITIVE FAB · POLYGRAPH / Provable Trust) is configurable per render: --brand "…", --footer "…", --no-brand, or meta.brand/meta.footer in the model or annotations. Ask which mark applies when rendering for someone else's org.
  4. Use hash to prove determinism in CI. The reference figures under ${CLAUDE_PLUGIN_ROOT}/reference/ are the visual acceptance bar.
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. 1mo ago Changed · +4 lines f23e9f9e2363
  2. 1mo ago First seen · 47 lines · 64 tokens per session scan A dd05cdc9d7f9

Subscribe to this mod's changes

polyviz is a command published in the GitHub repository cognitive-fab/polygraph (14 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 64 tokens to every session and 790 once invoked, about $0.0003 per session on Opus 5.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.