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.
npx agentmods add commands/cognitive-fab/polygraph/polyvizgit clone --depth 1 https://github.com/cognitive-fab/polygraphWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00064 | $0.00710 |
| Opus 5 | $0.00032 | $0.00355 |
| Sonnet 5 | $0.00013 | $0.00142 |
| Haiku 4.5 | $0.00006 | $0.00071 |
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 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.
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 schemaprints it): pureviz-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/
nextmodule), readinvariants.mjs, resolve a failingfindings.jsonto its counterexample trace, and mapcompat-report.json. Apolyviz.annotations.jsonin 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:
- Default to
--format svg(deterministic, diffable). Addpngonly for a raster deliverable. - When
--inis a run directory, warn that the machine graph is derived by executing the module, and offer apolyviz.annotations.jsonfor nicer copy. - Use
hashto prove determinism in CI. The reference figures under${CLAUDE_PLUGIN_ROOT}/reference/are the visual acceptance bar.
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.
- 2d ago First seen · 47 lines · 64 tokens per session scan A dd05cdc9d7f9
polyviz is a command published in the GitHub repository cognitive-fab/polygraph (11 stars, last pushed 6d ago), licensed Apache-2.0. It adds 64 tokens to every session and 710 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-31.
Other commands, from other repositories
sonicjs-seo-blog
Generate a high-quality, SEO-optimized blog post for SonicJS on the topic: $ARGUMENTS.
sonicjs-seo-audit
Perform a comprehensive SEO audit of the SonicJS documentation website (www/).
upgrade-webkit
Upgrade Bun's WebKit fork to the latest upstream version of WebKit.
dedupe
Find duplicate GitHub issues.
critique-pr
../../.mastracode/commands/critique-pr.md.
partition-dev
Derive test cases from Z specification using TTF testing tactics.