Fractal
A Claude Code plugin that maps a codebase into its domains and architecture patterns, so each change uses a fraction of the tokens and comes with a proof of what it touched.
Key metrics
Architecture
Fractal models an app as a tree: the app, its systems, their components, the files and the symbols in them. A deterministic compiler expands every system that matches a known pattern, and the model writes only what no pattern covers. References come from the language's own type checker, so the reach of a change is computed, not guessed. The engine runs hosted; every model call goes through the user's own Claude Code, and type checks and tests run on the user's machine.
Case study
Fractal
A coding agent finds its way around a repo by searching and reading files until it thinks it has seen enough. On a small repo that works. On a large one, each change costs hundreds of thousands of tokens of reading: in our runs, stock Claude Code read between 189,000 and 704,000 tokens to make one small change to a mid-sized library. A caller in a file the agent never opened stays broken, and nothing holds the change to the patterns the rest of the app follows.
Fractal is a Claude Code plugin that does the bookkeeping in code and asks the model only for judgment: what to change, and how to write it. Live at fractal.macleodlabs.com.
How it works
- Map. Fractal indexes every declaration, every reference between them and the tests that reach each one, then groups the modules into 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; code works out everything the change can reach: callers, overrides, comparisons against a changed value, and the tests that cover it.
- 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, it writes one and Fractal carries it to the rest in code.
- Prove. Fractal type-checks against the repo's own baseline, runs the tests that reach the change and writes a change proof. The 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. The app is a tree of systems, components, files and symbols. A deterministic compiler expands every system that matches a known pattern (a CRUD resource, sign-in, an API gateway); the model writes only the gaps.
- The reach of a change is computed. References come from the language's own type checker. On zod and ky the index finds every reference the TypeScript language service finds; on hono, 98%.
- Edit once, apply everywhere. On zod, one model-written edit was carried to 21 look-alike 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. No new type errors, then no previously passing test fails, then independent acceptance checks.
Results
Against stock Claude Code, both on Claude Opus 5.5, on 12 held-out architecture changes to a TypeScript service frozen before the run:
| Stock Claude Code | Fractal | |
|---|---|---|
| Accepted | 8 of 12 | 9 of 12 |
| Cost per change | $0.66 | $0.33 |
| Time per change | 128 s | 74 s |
| Tokens per change | 572k | 54k |
One run per side, so a one-task difference in acceptance is within noise: the same success rate at half the cost and a tenth of the tokens.
Your code stays with you
The engine runs hosted and is never shipped. Every model call goes through the user's own Claude Code subscription, type checks and tests run on their machine, and the engine keeps a job's files for 24 hours at most. Fractal changes TypeScript and Python, and maps 28 more languages read-only.
Tech stack
Gallery