Cognitive Fab › polyx › Get started
Get started · free

polyx-lens

Find out which of the rules your coding agents were given they actually kept. One command, no configuration, no model call, and nothing leaves the machine.

npx @cognitive-fab/polyx-lens
Apache-2.0 Node ≥ 22.18 ~8 s for 378 sessions reads Claude Code transcripts in place
01 / Run it

On your own sessions

Claude Code has written a transcript of every session to ~/.claude/projects since you installed it. The lens reads them where they are.

It says first what it could not check: sessions with no tool call are conversation only.

npx @cognitive-fab/polyx-lens
reading 378 sessions across 259 projects from ~/.claude/projects 134 of them called a tool at least once; 244 are conversation only and cannot be checked
02 / Read the report

What was done, and what was skipped

First, what your agents did, grouped by how hard it is to undo. Then each rule they were given, with how often they kept it and how often they broke it.

The rules come from contracts/claude-code.yaml: what Claude Code publishes about itself, such as “read the file before editing it”. They hold for every installation.

polyx lens — cc against the claude-code contracts (v1) 141 sessions · 111,926 events · 50,295 actions 3,927 events (3.5%) this alphabet cannot name — every figure below is measured over the rest WHAT YOUR AGENTS DID irreversible 1957 no way back from this machine 654 push to the remote 478 change cloud infrastructure or identity 390 delete files RULES YOU WERE GIVEN, AND BROKE (12) Load the browser skill before driving the browser. VIOLATED 299 of 299 times (100.0%) Look at the target before deleting it. VIOLATED 313 of 390 times (80.3%)

A real run on 141 real sessions. Every finding lists the session and event it came from.

03 / Trust the numbers

Three things it refuses to do

Hide what it cannot see. The share of events it could not name is printed before any finding. A compliance figure measured only over the part a parser understood is not a measurement.

Count “never came up” as a pass. A rule the corpus never exercised is reported on its own line.

Pretend every rule is checkable. Of the 28 clauses, 13 can be checked as one action coming before another. The other 15 are listed with the reason.

npx @cognitive-fab/polyx-lens audit
unknown events: 3068 (3.8% of events; gate 20.0%) unmatched shapes: 1797 speaker=action tool=Bash 588 speaker=action tool=PowerShell ...

audit shows exactly which shapes the alphabet could not type, so you can judge the gap yourself.

04 / No data of your own?

Try the shipped sample

Four generated sessions ship with the package, so you can see the report without your own data in it. The sample is generated rather than anonymised, because an anonymised transcript still shows the shape of someone’s work.

npx @cognitive-fab/polyx-lens cc-sample
RULES YOU WERE GIVEN, AND KEPT (7) 13 of 13 cc-read-before-write ... RULES YOU WERE GIVEN, AND BROKE (6) Read a file before editing it. VIOLATED 6 of 24 times (25.0%)
05 / Beyond Claude Code

Other agents, other logs

Five adapters ship: Claude Code transcripts, ABCD and τ²-bench customer-service conversations, BPIC 2017 process logs, and a synthetic fixture. Declare a corpus in polyx.config.json; a bare filename names a shipped alphabet and a path names your own.

Command bodies, file contents and prompts are never stored. Only the verb and the redacted path are kept.

// polyx.config.json { "corpora": { "team-agents": { "adapter": "cc", "source": "/path/to/transcripts", "alphabet": "alphabet.cc.yaml" } } }

The lens only checks rules that are already written down. To find the ones nobody wrote, you need polyx.

Next