Keep the reins on your code.

Untangle AI code before the PR is ever opened.

Don’t wait for a CI gate to tell you an agent broke your architecture.

Linters and GitHub Actions run after the work is done, and leave you reviewing messy diffs. Krypton closes the loop on your machine: your agent writes a change, Krypton scores it across the full syntax tree, and the agent refactors the hotspots before it opens a clean pull request.

  1. 1Agent editswrites the change on your machine
  2. 2Krypton scoresevery function, across the full syntax tree
  3. 3Agent refactorsthe hotspots, until the code meets your target
  4. 4Clean pull requestthe GitHub Action stays as an optional safety net

Know which functions kept your agent looping.

Every scored run is written to .krypton/runs.jsonl: the ticket, the score, and each function still over the limit, with how many times over it is. krypton review reads it and names the functions that were still stuck after your retry limit, and which run came closest.

# .krypton/runs.jsonl
{"run":0,"ticket":"fix discount rounding","purity":71,"functions":{"checkout.py::apply_discount":46.0}}
{"run":1,"ticket":"fix discount rounding","purity":71,"functions":{"checkout.py::apply_discount":45.0}}
{"run":2,"ticket":"fix discount rounding","purity":71,"functions":{"checkout.py::apply_discount":43.0}}
{"run":3,"ticket":"fix discount rounding","purity":71,"functions":{"checkout.py::apply_discount":44.0}}

$ krypton review
Ticket: fix discount rounding
Stuck after 3 runs: 1
  checkout.py · apply_discount: 46× → 45× → 43× → 44× (best: run 2)
# example values, trimmed; each log line also records the time

A real codebaseSee where your next agent will get stuck.We scanned garth, an open-source project: 41 files, drawn as trees of points, one per piece of code structure. 17,767 in all.

What it scoresKrypton scores how easy your code is for the next agent to edit and understand.It reads the shape of every function across the full syntax tree: how deep it nests, how many paths it takes, how much it holds at once.

Hard to changeIt lights up where the next agent will struggle.Eleven functions are too tangled to change safely. The darker and bigger the cluster, the worse it is. The worst is 46.2 times over the limit.

The fixYour agent untangles them until the code passes.With Krypton in the loop, the agent refactored garth’s hotspots locally and raised its score from 62 to 81, all 163 tests still passing, before a reviewer touched it. The animation is an illustration.See the savings

  • Tested ongarth
  • Score62 81
  • Source uploaded0 bytes
Score 62 / 100

Your source code never leaves your machine.

Krypton parses your code on your computer and swaps every function, variable and file name for a keyed hash. Only the structure is sent to be scored. The key is made fresh for every scan and stays with you.

$ krypton wire folder/filename.py
# prints exactly what would be sent for that file
$ krypton scan . --base origin/main
# scores only what this branch changed

Your agent cleans up after itself.

Run krypton setup to set a target score and a cap on retries. Your agent scans after each change, untangles deep nesting and branching hotspots by itself, and only asks for your sign-off when a function hits your retry limit. Answer the questions in the terminal, or click your settings on a local dashboard.

Krypton suggests a target from where you are: if your codebase scores 56, it suggests 70, and you can pick your own. Only new tickets are held to it, so the code they touch gets cleaner while old code never blocks a merge. Run setup again as the score climbs and the suggestion climbs with it.

Target score
Max tries
When stuck
Example review · fix discount roundingTarget 70Max tries 3Purity 71 71
checkout.py · apply_discount()
Stuck after 3 runs · best only 7% better

    Clean code is cheaper to change

    Once the code is cleaned up, an agent’s later changes to it cost less.

    17%average saving per later change, six runs
    6%the typical run
    Measured on garth. The cleanup costs money once; savings vary by repo.

    Smarter prompt caching

    Once your code is clean, reorder what your agent reads. Building your own agent? Run krypton order before you assemble its prompts: it replays your git history against several file orders and picks the one that reuses the most of the prompt cache, or leaves yours alone.

    $ krypton order

    GitHub Action 

    Need team-wide guardrails? krypton setup writes .github/workflows/krypton.yml for you. Hold each pull request to never worse, or to a target for the code it changes, without legacy code ever blocking a merge.

    Take the reins.

    Connect with GitHub, or install the CLI and wire Krypton into your agent’s loop to write cleaner code today.

    Visualize your code

    Try it on any public or private repository in your browser. No install needed.

    Continue with GitHub
    • Read-only access
    • Scored in memory, never stored
    • Access ends with your visit