Fractal

A Claude Code plugin for codebases that have outgrown your agent

Build using Architecture, not lines of Code

Fractal maps your application into its domains and the architecture patterns they follow, so AI agents can keep working on it as it grows. Each change uses a fraction of the tokens a stock agent spends, stays within the architecture you already have, and comes with a record of exactly what it touched.

  • Halfthe cost per change
    $0.33 against $0.66
  • 42%less time per change
    74 s against 128 s
  • 10×fewer tokens per change
    54k against 572k
  • Samesuccess rate
    9 of 12 against 8 of 12

Fractal against Claude Code alone, both on Claude Opus 5.5, making the same 12 held-out architecture changes to a service written and frozen before the run: reliable events, twelve-factor settings and shutdown, health, metrics and logs, and choosing between designs. Each change was judged by a hidden check neither side could see. One run per side. How we measured

Fractal's work board for a change to zod: what the change is, the 22 functions it edits, the risks with the modules behind them, and the plan's five steps, four done and the last waiting for you
A real change to zod (511 files, 3,946 declarations). The model wrote one function. Fractal found 21 functions with the same shape, carried the edit to each of them in code, and type-checked all 22. Three model calls in total.

Stock agents get slower and less reliable as the codebase grows

A coding agent finds its way around by searching and reading files until it thinks it has seen enough. That works on a small repo. On a large one, each change costs hundreds of thousands of tokens of reading, and the agent still knows only the files it happened to open.

The cost grows with the repo

In our runs, stock Claude Code read between 189,000 and 704,000 tokens to make one small change to a mid-sized library. Almost all of it was reading.

The reach of a change is a guess

A caller in a file the agent never opened stays broken until a test, a reviewer or a customer finds it.

The architecture erodes

Each change is written line by line. Nothing holds it to the patterns the rest of the app follows, so the design drifts a little with every edit.

How Fractal works

Fractal does the bookkeeping in code and asks the model only for judgment: what to change, and how to write it. You keep working in Claude Code; Fractal is the part that knows your architecture.

  1. Map

    Fractal indexes every declaration in the repo, every reference between them, and the tests that reach each one. It groups the modules into your app's business domains and recognises the architecture patterns they follow. zod's 103,000 lines index in 5.5 seconds, and in 0.2 seconds once cached.

  2. Plan

    You describe the change in words. The model picks the declarations to edit, and code works out everything the change can reach: callers, overrides, code that compares against a value you are changing, and the tests that cover it. You see the risks, with the lines behind them, before anything is written.

  3. Write

    The model rewrites whole declarations and sees only what each one needs. When the same edit belongs in many functions of the same shape, Fractal has the model write one and carries it to the rest in code.

  4. Prove

    Fractal type-checks the result against your repo's own baseline, runs the tests that reach the change, and writes a change proof: for each declaration, whether its interface changed and whether a test verifies its behaviour. Your repo is written only when you apply, and every change comes with a patch to undo it.

hono drawn as eight domains, such as Security, Request Handling and Runtime Adapters, with the number of references between them; the two domains holding the change are outlined
The whole app by domain. hono's 421 files fall into eight domains around a core framework; the two outlined ones hold this change.
The change proof for the zod change: 22 bounded changes listed by function, each marked interface unchanged, beside a map of the modules it reaches
The change proof: 22 bounded changes, no interface changed. This replay only type-checked; with tests on, each row names the tests that verify it.
Domain cards for hono: Core Framework, Runtime Adapters, Security and Request Handling, each with a one-sentence description, its size and how much of it is tested
Each domain in a sentence, with its size, how much of it tests reach, and whether a known pattern covers it.
The work board on a phone: the change, what it involves, and its risks with evidence
The same board on your phone. When a run needs a decision from you, you can answer it there.

What makes it work

Architecture is the unit of work

Fractal models an app as a tree: the app, its systems, their components, the files and the symbols in them. Systems that match a known pattern, such as a CRUD resource, sign-in or an API gateway, are expanded by a deterministic compiler. The model writes only what no pattern covers.

The reach of a change is computed

References come from the language's own type checker. On zod and ky, Fractal's index finds every reference the TypeScript language service finds; on hono, 98% of them.

Edits stay inside declarations

An edit replaces the exact text of the declarations it names. In every run we have measured, not one byte outside those declarations changed.

Edit once, apply everywhere

Fractal finds functions that differ only by names and literals. On zod it carried one edit to 21 such functions with no further model calls. All 22 were correct, all 5,506 of zod's tests still passed, and the model calls cost $0.07.

Evidence before you apply

Each change has to clear three levels: no new type errors, then no test that passed before now fails, then independent acceptance checks. The board shows how far a change got, and if it stopped, why.

Cheaper the more you use it

Verified solutions go into a library your team shares, and later work reuses them. Rebuilding our sample app with its library took 2 model calls instead of 6.

The numbers

Every figure here comes from a recorded run, with the same model on both sides: Claude Opus 5.5. Cost is at Anthropic's list prices; on a Claude subscription, the model calls are part of your plan.

  • Stock Claude Code
  • Fractal, driving the same model

Architecture changes (held out)

Twelve changes to an inventory service in TypeScript, each reaching across its modules: make events survive a failed publish and a redelivery, take settings from the environment and shut down cleanly, add health routes, metrics and structured logs, and decide between designs. Three tasks ask for a design decision, and for some of them the right answer is to keep the architecture as it is. Averages per change.

Accepted
Stock8 of 12
Fractal9 of 12
Cost
Stock$0.66
Fractal$0.33
Time
Stock128 s
Fractal74 s
Tokens
Stock572k
Fractal54k

A change counts as accepted when every step of its hidden check passes, no new type error appears and none of the repo's own tests that passed before now fails. Claude Code alone: 8 of 12. Fractal: 9 of 12. With one run per side and 12 tasks, a one-task difference is within run-to-run noise, so this is the same success rate, not a higher one. The two sides missed different tasks. Fractal was faster on 11 of the 12 changes, cheaper on 11, and used fewer tokens on all 12.

How we measured, and every architecture change
  • Macleod Labs wrote the service and the 12 tasks, without looking at Fractal's code, and froze them before the run. Each task has a hidden check that fails on the original code, passes on a reference solution and rejects a near miss; neither side ever saw it.
  • Claude Code alone (claude -p, Opus 5.5) got the task text and a fresh copy of the repo, with its own edit and search tools. Fractal got the same task text and called the same model once per question, with no agent tools.
  • One run per side, n = 12. These are measurements, not rates: a one-task difference in acceptance is within run-to-run noise, and a larger matrix is next.
  • Cost includes cache writes, at list price.
ChangeTokens
stock · Fractal
Cost
stock · Fractal
Time
stock · Fractal
Accepted
stock · Fractal
Events: publish reliably after the commit603k · 156k$0.80 · $0.92145 s · 189 syes · yes
Events: book a redelivered event once376k · 68k$0.48 · $0.3880 s · 69 sno · yes
Events: isolate a failing subscriber575k · 40k$0.73 · $0.27171 s · 54 syes · no
Twelve-factor: settings from the environment771k · 89k$0.73 · $0.51116 s · 94 syes · no
Twelve-factor: shut down gracefully646k · 29k$0.63 · $0.17105 s · 50 syes · yes
Twelve-factor: declare the runtime208k · 21k$0.22 · $0.1136 s · 23 sno · yes
Observability: health and readiness routes603k · 30k$0.62 · $0.19113 s · 57 syes · yes
Observability: Prometheus metrics690k · 46k$0.81 · $0.37164 s · 115 syes · no
Observability: structured, correlated logs576k · 49k$0.66 · $0.34149 s · 76 syes · yes
Design choice: partial reservations597k · 24k$0.70 · $0.16136 s · 46 sno · yes
Design choice: shipments all or nothing948k · 18k$0.97 · $0.11224 s · 30 syes · yes
Design choice: holds that expire on every instance264k · 82k$0.54 · $0.47102 s · 87 sno · yes
Average572k · 54k$0.66 · $0.33128 s · 74 s8 of 12 · 9 of 12

Single-declaration changes to public libraries

Nine changes to three widely used public TypeScript libraries, hono, ky and zod, each centred on one declaration and its uses: add an enum value and its uses, change a function's signature and update its callers, add a validation rule. Averages per change.

Tokens
Stock403k
Fractal25k
Cost
Stock$0.37
Fractal$0.19
Time
Stock75 s
Fractal55 s

A change counts as accepted when a hidden check passes and no new type error appears. Stock Claude Code: 9 of 9. Fractal: 8 of 9; the ninth stopped because it needed a declaration outside the edit, and passed when rerun after we let such declarations join. Fractal was faster on 7 of the 9 changes and cheaper on 8.

Building a new app from a spec

Two apps, a helpdesk and an investor CRM, each built in both TypeScript and Python from the same written spec. Totals per build.

Tokens
Helpdesk618k
Helpdesk134k
CRM963k
CRM159k
Cost
Helpdesk$0.86
Helpdesk$0.63
CRM$1.04
CRM$0.85
Time
Helpdesk166 s
Helpdesk93 s
CRM256 s
CRM130 s

Fractal's builds passed every step of their hidden acceptance suites in both languages (64 of 64 for the helpdesk, 49 of 49 for the CRM). The stock builds were scored on earlier, smaller suites (51 and 36 steps), which they also passed in full.

How we measured, and every single-declaration change
  • The tasks were written and frozen before any run. Each has a hidden check that fails on the original code and passes on a reference solution; neither side ever saw it.
  • Stock Claude Code (claude -p, Opus 5.5) got the task text and a fresh clone, with its own edit and search tools. Fractal called the same model once per question, with no agent tools.
  • Each row is one run per side. These are measurements, not rates: a larger matrix is next.
  • Cost includes cache writes, at list price.
ChangeTokens
stock · Fractal
Cost
stock · Fractal
Time
stock · Fractal
Accepted
stock · Fractal
hono: add an enum value395k · 16k$0.31 · $0.1051 s · 46 syes · yes
hono: change a signature209k · 39k$0.30 · $0.2846 s · 54 syes · yes
hono: add a validation rule296k · 13k$0.25 · $0.0937 s · 28 syes · yes
ky: add an enum value607k · 19k$0.49 · $0.15104 s · 34 syes · yes
ky: change a signature262k · 46k$0.29 · $0.4932 s · 128 syes · yes
ky: add a validation rule326k · 16k$0.35 · $0.1144 s · 30 syes · yes
zod: add an enum value704k · 21k$0.54 · $0.14143 s · 56 syes · no (rerun: yes, 28k, $0.18, 71 s)
zod: change a signature189k · 15k$0.23 · $0.0987 s · 43 syes · yes
zod: add a validation rule636k · 42k$0.60 · $0.31135 s · 77 syes · yes
Average403k · 25k$0.37 · $0.1975 s · 55 s9 of 9 · 8 of 9

Your code and your models stay with you

The engine runs on our servers and is never shipped. Anything that needs a model or runs your code happens on your machine, through the Claude Code you already use.

Models run on your subscription

Every model call goes through your own Claude Code (claude -p). We never hold a model key, and models are never on our bill.

Your code runs on your machine

Type checks and tests run on your machine, in a copy of your repo, sandboxed if you ask. Your repo changes only when you apply.

Files are kept for 24 hours at most

The engine receives the files a job needs, by content hash, keeps them for that job only and deletes them when it ends. They are never logged and never used for anything else. What we see and keep

Pricing

Freewhile Fractal is in preview; then $49 per user per month

  • One seat for each person who runs changes. On your own, you are a team of one.
  • The owner invites people by email, and they join with their own sign-in.
  • Add or remove seats at any time, prorated by Stripe, once billing starts.
  • Models run on your own Claude subscription, never through us.
Add it to Claude Code

Install

Fractal is a Claude Code plugin. Its client runs on your machine (Node 20 or later on macOS, Linux or Windows): it passes the engine's questions to your Claude Code and runs your checks.

  1. Add the plugin (in Claude Code)
    /plugin marketplace add macleodlabs-ai/fractal-plugin
    /plugin install fractal@fractal
  2. Connect it to your account (opens a page to sign in with GitHub or email)
    /fractal:connect
  3. Ask for a change, or map a repo
    /fractal:edit <the change, in words>
    /fractal:scan

Questions

Which languages does it work with?
Fractal makes changes in TypeScript and Python. It maps 28 more languages read only, including Go, Rust, Java, Kotlin, C#, Ruby and PHP; there, references are matched by name, and the map says it is approximate.
Does it replace my coding agent?
No. You keep working in Claude Code. When a change has to reach across a large codebase, you hand it to Fractal from Claude Code and get back a checked patch with its evidence.
What happens when a change needs a decision?
The run stops and asks, on the board, in Claude Code or on your phone. Applying a change to your repo always waits for you.
What if Fractal can't finish a change?
It stops and says why, for example a type error it could not repair, or a declaration outside the change that would also have to change. Nothing is written to your repo.