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
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.
-
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.
-
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.
-
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.
-
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.
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.
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.
| Change | Tokens stock · Fractal | Cost stock · Fractal | Time stock · Fractal | Accepted stock · Fractal |
|---|---|---|---|---|
| Events: publish reliably after the commit | 603k · 156k | $0.80 · $0.92 | 145 s · 189 s | yes · yes |
| Events: book a redelivered event once | 376k · 68k | $0.48 · $0.38 | 80 s · 69 s | no · yes |
| Events: isolate a failing subscriber | 575k · 40k | $0.73 · $0.27 | 171 s · 54 s | yes · no |
| Twelve-factor: settings from the environment | 771k · 89k | $0.73 · $0.51 | 116 s · 94 s | yes · no |
| Twelve-factor: shut down gracefully | 646k · 29k | $0.63 · $0.17 | 105 s · 50 s | yes · yes |
| Twelve-factor: declare the runtime | 208k · 21k | $0.22 · $0.11 | 36 s · 23 s | no · yes |
| Observability: health and readiness routes | 603k · 30k | $0.62 · $0.19 | 113 s · 57 s | yes · yes |
| Observability: Prometheus metrics | 690k · 46k | $0.81 · $0.37 | 164 s · 115 s | yes · no |
| Observability: structured, correlated logs | 576k · 49k | $0.66 · $0.34 | 149 s · 76 s | yes · yes |
| Design choice: partial reservations | 597k · 24k | $0.70 · $0.16 | 136 s · 46 s | no · yes |
| Design choice: shipments all or nothing | 948k · 18k | $0.97 · $0.11 | 224 s · 30 s | yes · yes |
| Design choice: holds that expire on every instance | 264k · 82k | $0.54 · $0.47 | 102 s · 87 s | no · yes |
| Average | 572k · 54k | $0.66 · $0.33 | 128 s · 74 s | 8 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.
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.
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.
| Change | Tokens stock · Fractal | Cost stock · Fractal | Time stock · Fractal | Accepted stock · Fractal |
|---|---|---|---|---|
| hono: add an enum value | 395k · 16k | $0.31 · $0.10 | 51 s · 46 s | yes · yes |
| hono: change a signature | 209k · 39k | $0.30 · $0.28 | 46 s · 54 s | yes · yes |
| hono: add a validation rule | 296k · 13k | $0.25 · $0.09 | 37 s · 28 s | yes · yes |
| ky: add an enum value | 607k · 19k | $0.49 · $0.15 | 104 s · 34 s | yes · yes |
| ky: change a signature | 262k · 46k | $0.29 · $0.49 | 32 s · 128 s | yes · yes |
| ky: add a validation rule | 326k · 16k | $0.35 · $0.11 | 44 s · 30 s | yes · yes |
| zod: add an enum value | 704k · 21k | $0.54 · $0.14 | 143 s · 56 s | yes · no (rerun: yes, 28k, $0.18, 71 s) |
| zod: change a signature | 189k · 15k | $0.23 · $0.09 | 87 s · 43 s | yes · yes |
| zod: add a validation rule | 636k · 42k | $0.60 · $0.31 | 135 s · 77 s | yes · yes |
| Average | 403k · 25k | $0.37 · $0.19 | 75 s · 55 s | 9 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.
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.
-
Add the plugin (in Claude Code)
/plugin marketplace add macleodlabs-ai/fractal-plugin/plugin install fractal@fractal -
Connect it to your account (opens a page to sign in with GitHub or email)
/fractal:connect -
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.