polyscan

Open source · Go + tree-sitter

polyscan

Code quality analyzers for AI agents.

Building with Claude, Cursor, or Codex? Your agent writes code faster than anyone can review it. polyscan runs structural analysis over the whole codebase — one command scores it and shows what to fix first.

Python

$uvx pyscn@latest analyze .

JavaScript / TypeScript

$npx jscan analyze src/

No installation, no sign-up, no code leaves your machine.

What you get

Every analyzer scores your codebase from 0-100 with an A-F grade and generates an HTML report, looking at your code from five angles.

Dead code

Unreachable code you can safely delete, found by walking the control flow graph rather than guessing.

Duplicate code

Copy-pasted and structurally similar code worth merging — Type 1-4 clone detection via tree edit distance.

Complexity

Functions that are hard to read and hard to test, ranked by cyclomatic complexity so you know where to start.

Dependencies

Circular imports and unstable module dependencies, plus the module communities your codebase actually forms.

Class design

Classes that do too much or depend on too much, measured with CBO coupling and LCOM cohesion.

One engine, one analyzer per language

The analysis algorithms live in a shared, language-agnostic Go module. Each analyzer only implements parsing and classification, so Python and TypeScript are graded by the same rules.

pyscn

Python

The original analyzer. Ships a CLI, an MCP server, and Agent Skills, and powers pyscn-bot.

uvx pyscn@latest analyze .

jscan

JavaScript / TypeScript

The same analysis for JS and TS, distributed on npm with prebuilt binaries — no toolchain to install.

npx jscan analyze src/

core

Go module

The language-agnostic engine behind both: APTED tree edit distance, LSH/MinHash clone indexing, CFG analysis, coupling and cohesion metrics.

go get github.com/ludo-technologies/polyscan/core

C++, Go, and Rust analyzers are planned.

Built for coding agents

The analyzers ship Agent Skills that teach an AI agent when and how to run each analysis — health checks, refactoring, architecture review, and CI-friendly reports. They work with Claude Code, Cursor, Codex, Gemini CLI, and others.

pyscn Skills

$uvx add-skills ludo-technologies/pyscn

jscan Skills

$npx skills add ludo-technologies/polyscan

Claude Code plugin

$claude plugin marketplace add ludo-technologies/polyscan

Then just ask

  • Analyze the code quality of the src/ directory
  • Find duplicate code and help me refactor it
  • Show me complex code and help me simplify it

Also from polyscan

Pyscn Bot — code review that reads the architecture

A GitHub App that reviews every pull request with pyscn in hand and files a weekly audit of the whole repository. Because it reviews with a static analyzer rather than the diff alone, it catches the structural problems a line-by-line reviewer never sees. Weekly audits are free for every repository.

Frequently asked questions

Q.What does polyscan actually measure?

Structure, not style. Dead code, duplicate code, cyclomatic complexity, module dependency cycles, and class coupling and cohesion — the things that make a codebase expensive to change. It is not a linter or a formatter, and it complements rather than replaces them.

Q.Why does this matter for AI-generated code?

Coding agents produce working code quickly, but they tend to duplicate logic and grow functions rather than refactor. Those problems compound silently. polyscan gives you and your agent a measurement to work against, so cleanup becomes a concrete task instead of a vague feeling.

Q.Do I need to install anything?

No. uvx and npx run the analyzers directly. Both ship as single Go binaries built with tree-sitter, so a full analysis is fast enough to run on every commit.

Q.Which languages are supported?

Python via pyscn and JavaScript/TypeScript via jscan today. Because the analysis lives in a language-agnostic Go core, adding a language mostly means implementing parsing and classification — C++, Go, and Rust are planned.

Q.Is it open source?

Yes, MIT licensed. The analyzers, the shared core, and the Agent Skills are all public on GitHub.

Score your codebase in one command

Run it on the repository you are working in right now — it takes seconds and installs nothing.

$uvx pyscn@latest analyze .
$npx jscan analyze src/