Skip to content
Michael L. McKnight edited this page Dec 5, 2026 · 4 revisions

Code Cleaner

Catch the bugs AI-written code leaves behind, in 12 languages, with one command.

Code Cleaner is a static analyzer from ML Innovations Research Lab. It finds problems that show up in rushed or AI-generated code — hallucinated imports, hardcoded secrets, eval() on user input, shell commands built from strings, bare except: blocks, leftover debug prints — in Python, JavaScript, TypeScript, Java, C#, C++, SQL, Go, Ruby, Rust, HTML and SCRAWL. Every file gets a quality score and a security grade. It can write SARIF 2.1.0 for GitHub code scanning and fail a CI build before bad code ships.

The core is pure Python standard library: no third-party dependencies, no account, no server, and it works offline. The latest release is v1.4.0 (December 4, 2026), which covers 11 languages (TypeScript is not in that tag). TypeScript and the other Unreleased items in the Changelog are on main and ship in the next release. Code Cleaner is not on PyPI yet; installing from GitHub is the supported way.

This wiki is a short guide. The canonical, detailed docs live in the repository and are linked from every page, so the two do not drift.

Repository: github.com/ZodiacDog/Code-Cleaner

Code Cleaner flags a hardcoded API key and traces an LLM agent's HTTP tool call through helper functions into subprocess and SQL, then a clean re-scan, then compiles a SCRAWL consensus message to 72 bytes versus 471 bytes of JSON

A real, reproducible ~30-second terminal recording (MP4; sources and VHS tape in examples/demo/).

Install

Python 3.10 or newer. This pins the latest release, v1.4.0:

pip install "git+https://github.com/ZodiacDog/Code-Cleaner@v1.4.0"       # core, standard library only
code-cleaner analyze your_project/

For full parsers (tree-sitter, esprima, javalang):

pip install "code-cleaner[all] @ git+https://github.com/ZodiacDog/Code-Cleaner@v1.4.0"

To use what is on main before the next release (TypeScript, inline suppressions, [tool.code-cleaner] project config, Java taint, and one-level Python inter-procedural taint), omit the tag:

pip install "git+https://github.com/ZodiacDog/Code-Cleaner"
pip install "code-cleaner[all] @ git+https://github.com/ZodiacDog/Code-Cleaner"

See Getting Started for a clone-based install, optional extras, and code-cleaner version.

Quick start

code-cleaner analyze app.py src/                     # text report; folders are walked recursively
code-cleaner analyze src/ --format json -o report.json
code-cleaner analyze src/ --format sarif -o results.sarif
code-cleaner analyze src/ --fail-on high --min-score 80
code-cleaner fix examples/fixdemo/app.py --provider mock -o fixed.py
code-cleaner scrawl check|compile|run FILE           # SCRAWL: compile check, SYNAPSE bytes, run on the VM

analyze defaults to --fail-on none (report only). fix defaults to --min-score 90 and --fail-on high. Exit code 0 means the gate passed, 1 means it failed, and 2 is a usage or input error.

A before-and-after walkthrough, with recorded output, is in the README and examples/before_after/. The terminal recording at the top of this page (and of the README) is the inter-procedural taint and SCRAWL demo from examples/demo/.

SCRAWL

SCRAWL (Structured Compressed Runtime for Agent-to-Agent Workload Language) is ML Innovations Research Lab's binary instruction set for agent-to-agent communication, created to combat latency. Agents exchange compact SYNAPSE frames — 75–85% smaller than the equivalent JSON in SCRAWL's own measurements — and execute them instead of parsing text. You write it in readable ROSETTA text (.scrawl or .rosetta).

Code Cleaner v1.4.0 includes a built-in ROSETTA v1.4 compiler, so you can check and compile SCRAWL with no extra install:

code-cleaner analyze examples/scrawl/hello.scrawl
code-cleaner scrawl compile examples/scrawl/hello.scrawl
code-cleaner scrawl run examples/scrawl/hello.scrawl       # needs the separate rosetta tool

Start with SCRAWL and Rosetta Stone. The full guide is Using SCRAWL with Code Cleaner. A SCRAWL-first design repo, Code-Cleaner-SCRAWL, has plans only: nothing in it runs yet.

Wiki and docs

Wiki page Canonical doc
Getting Started README: Install and Quickstart
Languages README: Supported languages
SCRAWL docs/languages/scrawl.md, USING_SCRAWL.md
Rosetta Stone docs/languages/scrawl/ROSETTA_STONE.md
Rules docs/rules.md (322 rule ids on main)
Scoring docs/scoring.md
Taint Tracking docs/taint-tracking.md
Fix Loop docs/fix-loop.md
Integrations docs/integrations.md
Adding a Language docs/adding-a-language.md
Contributing CONTRIBUTING.md
FAQ —
Changelog CHANGELOG.md

How the pipeline works: docs/architecture.md. Test results from real runs: docs/test-results.md.

Credits and license

  • Michael L. McKnight / ML Innovations Research Lab: creator and primary author.
  • Korg (AI assistant, Grok Bot): contributor.
  • SCRAWL was created by Michael L. McKnight / ML Innovations Research Lab.

See AUTHORS.md. Licensed under the Apache License 2.0.

Clone this wiki locally