Holographic diagnostic eye scanning code on a laptop, flagging CRITICAL, HIGH, PHANTOM IMPORT and HALLUCINATED API severity tags
v0.7.0 · Public Beta

Thuban Scan finds what AI coding tools leave behind.

Hallucinated APIs. Phantom imports. Security vulnerabilities. Dead code. Tech debt. One command scans your codebase and tells you exactly what's broken — and what to do about it.

Watch it work ↓
<60sTo Deploy & Run
5Failure Modes Caught
<2sScan Time
0Cloud Calls
Local only. Your code NEVER leaves your machine.
69 Rules 10 Languages Zero Cloud
What Scanner Is

Thuban's codebase audit engine.

One command scans your entire project for vulnerabilities, phantom imports, hallucinated APIs, stale dependencies, and AI-generated code patterns that look right but aren't. Your AI agent wrote 2,000 lines in 40 minutes. How much of it is actually safe? Traditional linters check syntax. Scanner checks reality.

What AI coding tools do wrong

Import modules that don't exist in your project
Call API methods that were deprecated years ago
Paste utility functions then never call them
Duplicate logic across files that slowly drifts apart
Generate code that looks perfect but crashes in production

What Thuban Scan does about it

Scans every file for phantom imports and fake APIs
Flags deprecated patterns before they break on upgrade
Finds dead functions that inflate your bundle
Detects copy-paste drift before it causes bugs
Fixes what it can, reports what it can't — in seconds

What It Finds

01

Phantom imports

Modules that don't exist in your package.json or node_modules — the ones an AI agent invented mid-generation.

02

Hallucinated APIs

Function calls to APIs that don't exist or have the wrong signature — code that compiles but fails at runtime.

03

Known CVEs

Dependencies with published vulnerabilities, cross-referenced against your actual installed versions.

04

Stale dependencies

Deprecated versions still in production, quietly accumulating risk until an upgrade forces a breaking change.

05

Dangerous patterns

eval, exec, os.system in loops — code patterns that are one bad input away from arbitrary execution.

06

AI anti-patterns

Code that compiles, passes review, and fails silently in production — the specific failure signature of AI-generated code.

thuban scan . — one command, full report, seconds not hours.

Thuban Scan is the safety layer between AI-generated code and your production environment. Thuban Shield is the safety layer between AI agents and your filesystem while they work.
Deploy in under 60 seconds. Run one command. Get a health score. Fix what's broken. Move on.

Everything runs locally. Your code never leaves your machine.

Mother Code DNA

Every file knows what it does, what depends on it, and what breaks if it changes.

Mother Code is Thuban's unique self-awareness layer. It turns your codebase from a bag of files into a connected, self-documenting system.

BEFORE: A normal file

// utils/calculateScore.js

function calculateScore(issues, files) {
  let score = 100;
  issues.forEach(i => {
    score -= i.severity * 2;
  });
  return Math.max(0, score);
}

module.exports = { calculateScore };

No context. No purpose. No connections. Just code floating in a folder.

AFTER: With Mother Code DNA

/**
 * @thuban-purpose Calculates health score from issues
 * @thuban-owner scanner
 * @thuban-depends-on hallucination-detector, tech-debt
 * @thuban-depended-by cli.js, html-report.js, dashboard
 * @thuban-sacred false
 * @thuban-last-verified 2026-06-27
 */

function calculateScore(issues, files) {
  let score = 100;
  issues.forEach(i => {
    score -= i.severity * 2;
  });
  return Math.max(0, score);
}

module.exports = { calculateScore };

Now the file knows its purpose, its owner, and what breaks if you change it.

When every file has DNA, Thuban can detect drift — when a file's code no longer matches its declared purpose. It can detect breaking changes — when you edit a file that other files depend on. And it gives new team members instant context — read the header, understand the file.

npx thuban inject . Add Mother Code DNA to every file in your project

See It In Action

What you actually see when you run Thuban

Real output from a real scan. No mockups. No staged demos.

Thuban Scan terminal output showing hallucinated API detection and a 91 Trust Score gauge
thuban scan ./e-commerce-app
Trust Score
--
Click any finding to see the code
Waiting...

Thuban Scan in 60 seconds — install → scan → fix → clean

1

Run the scan

$ npx thuban scan .

  SCANNING: /my-project
  Found 1547 files to scan...

  ╔══════════════════════════════════════════════════════╗
  ║  THUBAN SCAN                                        ║
  ╠══════════════════════════════════════════════════════╣
  ║  Files scanned:     1547                            ║
  ║  Health score:      D+ (52/100)                     ║
  ║  Scan time:         1017ms                          ║
  ╚══════════════════════════════════════════════════════╝

  HIGH: 1 Deprecated API (will break on Node upgrade)

    server.js:24
    url.parse() — deprecated since Node 11
     Use new URL() — url.parse() is legacy

  CODE QUALITY: 86 issues
    ! cdp-connector.js:21  Hardcoded localhost URL
    ! takeover.js:45       Hardcoded localhost URL
    ... 84 more
2

Preview fixes (safe — nothing changes yet)

$ npx thuban fix .

  DRY RUN — showing what would change (no files modified)

  SAFE FIX: server.js:24
    - const parsed = url.parse(reqUrl);
    + const parsed = new URL(reqUrl, base);

  SAFE FIX: cdp-connector.js:21
    - const ws = 'ws://localhost:9222';
    + const ws = process.env.CDP_URL || 'ws://localhost:9222';

  61 fixes available | 61 safe | 0 unsafe
  Run with --fix to apply
3

Apply fixes (each one is a git commit you can revert)

$ npx thuban fix . --fix --commit

  FIXED: server.js:24 — replaced url.parse with new URL
         committed: thuban-fix: update deprecated url.parse
  FIXED: cdp-connector.js:21 — environment variable for CDP URL
         committed: thuban-fix: use env var for CDP URL
  ...

  61 fixes applied. 61 git commits created.
  Don't like a fix? Run: git revert <commit>
4

Share the report with your team

$ npx thuban dashboard .

  Dashboard saved: thuban-report-2026-06-27.html
  Open it in your browser — share it with your CTO.
  Score rings, category breakdown, every issue listed, fixable items highlighted.
5

Scan any GitHub repo — without cloning it yourself

$ npx thuban scan https://github.com/company/their-api

  Cloning repository...
  Cloned successfully

  SCANNING: their-api
  Found 892 files to scan...

  ╔══════════════════════════════════════════════════════╗
  ║  Health score:      C (68/100)                       ║
  ╚══════════════════════════════════════════════════════╝

  14 AI hallucination risks
  23 deprecated APIs
  42 code quality issues

  (temporary clone removed — nothing stored)
6

Compare two codebases side by side

$ npx thuban compare ./our-app https://github.com/competitor/app

  ┌──────────────────────┬──────────────────────┬──────────────────────┐
  │ METRIC               │ our-app              │ competitor-app       │
  ├──────────────────────┼──────────────────────┼──────────────────────┤
  │ Health Score          │ B (85/100)D+ (52/100)          │
  │ Grade                 │ BD+                   │
  │ Files Scanned         │ 301                  │ 1547                 │
  │ Total Issues          │ 3                    │ 87                   │
  │ Hallucinations        │ 0                    │ 14                   │
  │ Circular Deps         │ 0                    │ 4                    │
  │ Mother Code DNA       │ 92%                  │ 0%                   │
  └──────────────────────┴──────────────────────┴──────────────────────┘

  VERDICT: our-app is healthier
  33 point difference — significant gap
Why Thuban

Not another linter. A different category.

Existing tools check syntax. Thuban checks whether your code is real, safe, and maintainable — regardless of who or what wrote it.

Feature Thuban ESLint SonarQube Socket.dev Semgrep
AI hallucination detection (multi-language)
Advisor Mode (roast/rate/boost/risk/…)
Self-verifying Kill Switch (blocks on broken scanner)
Public community leaderboard
Ghost code detection Partial
AI risk scoring per function
Tech debt cost in $ / hours Partial
Pre-commit hallucination gate
Copy-paste drift detection Custom rule needed
Codebase passport / identity
Zero config / npx command Needs .eslintrc Server required Needs account/API key
CTO executive PDF report Partial Dashboard, no PDF
Auto-fix Limited Some rules
Safe/unsafe fix separation
Baseline / delta scanning Limited Partial Partial
Scan any GitHub repo (no clone)
Side-by-side codebase comparison
Rule IDs + inline suppression
Adversarial testing (The Crucible)
Chaos & mutation testing
Golden master regression guard Partial
Malicious / supply-chain package detection (their core strength)
Broad multi-language SAST ruleset 9 languages, AI-failure focused JS/TS only (their core strength)
Local-first (no account / cloud upload required) Server required Cloud-based
AI agent filesystem containment (Thuban Shield)
Price Free / $9/mo Free $150+/mo Freemium / paid tiers Free / paid tiers

Where we overlap, honestly: Socket.dev is a strong, funded supply-chain security tool — if you need malicious-package detection across your dependency tree, it's excellent at that, but it doesn't test your own code for AI hallucinations, adversarially verify itself, contain what an AI agent can do to your filesystem, or carry Mother Code DNA across refactors. Semgrep is a powerful, free, local SAST engine with huge language coverage and community rules — but it has no AI-specific scanning, no hallucinated-package detection, no filesystem containment, and no adversarial self-verification loop. Thuban was built for a class of problem these tools weren't designed to catch: code that looks syntactically correct, passes a linter, and still calls an API that was never real — plus the newer problem of an AI agent with write access to your repo. Thuban Scan finds the code problems, Thuban Shield contains the agent while it works, and Crucible proves both actually hold up. Many teams run Thuban alongside Socket.dev and/or Semgrep — they solve different problems.

Only in Thuban

Compare any two codebases. Instantly.

Side-by-side health comparison with a verdict. Built for AI-code failure modes traditional linters miss.

Why does this exist?

Every day, CTOs sign contracts with vendors they've never audited. Teams refactor code with no way to prove it improved. Agencies deliver projects with no objective quality proof. Developers inherit repos and have no idea how bad the situation is.

Thuban Compare solves this in one command. Point it at any two codebases — local folders, GitHub repos, or a mix of both — and get a full side-by-side health report with a clear verdict. No setup. No configuration. No meetings. Just data.

Built for a class of problem traditional linters were never designed to catch.

How it works

  1. You run npx thuban compare [codebase A] [codebase B]
  2. If either target is a GitHub URL, Thuban shallow-clones it to a temporary folder automatically
  3. Both codebases are scanned simultaneously using the full Thuban engine — hallucination detection, dependency mapping, drift analysis, DNA coverage, tech debt scoring, everything
  4. Results are placed side by side in a comparison table with colour-coded metrics
  5. Thuban calculates the score gap and delivers a verdict: significant gap, moderate gap, or close race
  6. Any temporary clones are deleted immediately — nothing is stored, nothing is uploaded

Scans complete in under 2 seconds after clone. Both scans run locally on your machine. Your code never leaves your laptop — the only optional network calls are supply-chain lookups that check dependency names (never source) against public registries. Use --offline to disable.

What the comparison shows

Metric your-app vendor-api
Health Score B (85/100) D+ (52/100)
Files Scanned 301 1,547
Total Issues 3 87
AI Hallucinations 0 14
Critical Issues 0 6
Circular Dependencies 0 4
Orphan Files 2 31
Mother Code DNA 92% 0%
Drift Issues 1 18
Scan Time 99ms 977ms
VERDICT: your-app is significantly healthier
33 point gap — significant difference in code quality

Who uses this and why

Evaluate a vendor

CTO about to sign a $200k contract? Scan their repo first. See if their code is production-grade or held together with duct tape.

📈

Before vs after refactor

Prove refactoring ROI. Run compare on last month’s snapshot vs today. Show the board a 40-point health improvement.

Benchmark vs competitors

Compare your code against any open-source repo. Know exactly where you stand. Use the report in investor decks and pitches.

💼

Show a client

Agency delivering code? Run compare against industry standard. Hand the client a side-by-side proof of quality. Close the deal.

npx thuban compare ./my-app https://github.com/company/their-app

Works with any mix of local folders and GitHub URLs. Scans complete in under 2 seconds after clone.

Auto-Fix

What does auto-fix actually do to your code?

Thuban reads your files, applies text replacements, and writes them back. Here is every fix it makes, with exact before/after.

How it works mechanically

  1. You point Thuban at a folder: npx thuban fix . --fix
  2. Thuban reads every source file in that folder using Node.js
  3. For each file, it applies safe text replacements (regex-based pattern matching)
  4. It writes the updated file back to disk
  5. With --commit, it creates a git commit so you can git revert any fix

Nothing is deleted. Nothing is uploaded. No network calls. It's a local find-and-replace engine with safety guards.

SAFE FIXES (default — no runtime behaviour change)

Inject Mother Code DNA
Adds a structured comment block to the top of each file. Does not change any actual code.
+ /**
+  * @thuban-purpose Express server configuration
+  * @thuban-owner api
+  * @thuban-depends-on express, auth-middleware
+  */
  const express = require('express');  // unchanged
Remove debug console.logs
Removes console.log() calls. Keeps console.error() and console.warn().
- console.log('debug: user data', userData);
  console.error('Failed to connect');  // kept
Update stale Mother Code annotations
When a file's imports or purpose have changed, regenerates the DNA block to match the current code.

UNSAFE FIXES (requires --unsafe flag — changes runtime behaviour)

Replace deprecated API calls
Swaps deprecated Node.js APIs for their modern equivalents.
- const parsed = url.parse(reqUrl);
+ const parsed = new URL(reqUrl);

- const buf = new Buffer('hello');
+ const buf = Buffer.from('hello');

- const sys = require('sys');
+ const sys = require('util');
Wrap hardcoded localhost URLs
Wraps hardcoded localhost URLs in environment variable fallback so they work in production.
- const api = 'http://localhost:8080/api';
+ const api = (process.env.SERVICE_URL_8080 || 'http://localhost:8080/api');

Things Thuban will NOT auto-fix

  • Hardcoded secrets — flagged for manual review (too risky to move automatically)
  • Orphan files — confirmed as unused but not deleted (your decision)
  • Circular dependencies — identified but restructuring requires human judgement
  • Complex logic bugs — Thuban is a pattern scanner, not an AI rewriter
Features

25 commands. Zero dependencies. Works on any codebase — JavaScript, TypeScript, Python, PHP, Ruby, Go, Rust, Java, Kotlin, C# and more.

Diagnostic eye X-raying layers of code with CRITICAL, HIGH, PHANTOM IMPORT and HALLUCINATED API severity markers floating off the stack

Every file X-rayed layer by layer — severity tags surface exactly where and what broke

AI hallucination detection — the flagship feature

🔒

Secret Exposure Scanner

Detect hardcoded API keys, passwords, secrets in source code, .env files not gitignored, database connection strings with passwords, private keys, high-entropy strings, and secrets still exposed in git history.

Only in Thuban
🔮

AI Hallucination Detection

Find phantom imports, invented APIs, and deprecated patterns that AI coding tools leave behind. Built specifically to catch the failure modes AI coding tools create.

Only in Thuban

Tech Debt Scoring

Get a clear 0-100 score across Security, Architecture, Code Quality, Dependencies, and Mother Code coverage. Grade A through F.

🔧

Auto-Fix Button

One command fixes hundreds of issues automatically. Inject annotations, remove debug logs, update deprecated APIs, break circular deps.

🧬

Mother Code DNA

Inject contextual DNA into every file. Your codebase becomes self-aware — every file knows what it does, what depends on it, and what breaks if it changes.

Only in Thuban
📈

Visual Dashboard

Beautiful HTML reports you can email to your CTO. Score rings, category breakdowns, fixable items grid. Dark theme. Print-friendly.

GitHub CI Action

Drop one file into your repo. Every PR gets a grade comment. Block merges below threshold. Dashboard artifact on every run.

🚫

Pre-Commit Gate

Block bad code before it enters your repo. 3-second scan on every commit catches hallucinated APIs instantly. Install once, forget forever.

Only in Thuban
💰

Tech Debt Cost Calculator

Translate tech debt into dollars and hours. Show your CTO exactly what bad code costs per month — and what Thuban saves. ROI in one command.

CTO Favourite
👻

Ghost Code Detection

Find AI-pasted functions that exist but are never called. Dead code inflates your bundle, confuses devs, and hides bugs. Thuban finds every ghost.

Only in Thuban
🤖

AI Risk Score

Per-function risk assessment for AI-generated code. Scores every function 0-100% using 12 signals. Know exactly which code needs human review before it ships.

Only in Thuban
📋

Copy-Paste Drift

Find similar code blocks scattered across files. Thuban clusters duplicates and recommends shared utilities. Kill redundancy before it kills you.

📄

Codebase Passport

One JSON file that describes your entire project — languages, architecture, sacred files, entry points, onboarding guide. New devs productive in minutes.

Onboarding Killer
🔍

Dependency Mapping

Full dependency graph with circular detection, orphan files, critical path analysis. Know what breaks before you change it.

💡

Drift Detection

Code evolves. Annotations become stale. Thuban detects when files have drifted from their declared purpose and flags the gap.

👁

Live Sentinel

Watch mode monitors your codebase in real-time. Save a file, get instant feedback. Hallucination check on every keystroke.

🔒

Safe-by-Default Fixes

Dry-run preview before any changes. Safe/unsafe separation. Git commit mode for easy rollback. Thuban never changes runtime behaviour without your explicit opt-in.

Senate Approved
📐

Baseline & Delta Scanning

Snapshot your current issues. Future scans only flag NEW problems. Perfect for CI — don't fail on legacy debt, only fail on new mistakes being merged.

CI Essential
📜

Rule IDs & Suppression

Every detection has a unique rule ID (HALL_API001, DEPR_API003). Suppress false positives with a simple // thuban-ignore HALL_API001 comment. Full transparency.

🌐

Scan Any GitHub Repo

Paste any public GitHub URL and Thuban clones, scans, scores, and cleans up automatically. No need to clone repos manually. Evaluate any codebase in 30 seconds.

Only in Thuban

Codebase Comparison

Compare two codebases side by side — local or remote. Health score, issues, dependencies, DNA coverage, and a verdict with gap analysis. Perfect for evaluating vendors, benchmarking against competitors, or measuring before vs after a refactor.

Only in Thuban

Thuban Scan is the “Find” engine.

Three engines, one CLI. Thuban Shield stops AI agents from destroying your code before it happens. Crucible proves the defences actually hold up. Thuban Scan finds what everyone else misses.

3. Thuban Scan — Find

69 rules, 10 languages, catch what others miss

Security detection, AI hallucination detection, ghost code, clone/copy-paste drift, and dependency mapping in one pass — plus 8 Advisor commands (roast, rate, boost, risk, trend, benchmark, onboard, compliance) that turn raw findings into a prioritised roadmap.

Terminal — Thuban Advisor (part of Thuban Scan)
$ npx thuban advisor roast .
 
Reading the room... this is going to hurt.
 
“auth-service” scored 41/100. Here’s the damage report:
 
• 3 hardcoded secrets sitting in source like it's 2009.
• 12 functions nobody calls anymore — ghosts haunting your repo.
• A 340-line function called `handleEverything()`. Bold name.
• Zero tests on your payment path. Bold strategy, Cotton.
 
Run `thuban advisor boost .` for the un-roasted version — a real fix plan.

roast is for laughs — clearly labelled as entertainment. rate gives you the same data as a straight /100 score across security, architecture, dependencies, maintainability, and test coverage.

Want the full picture? See Thuban Shield and Crucible.

Thuban Help
Ask a question or pick a topic below.