Fractal让Claude Code能干大活了——分块并行,还能断点续传,再也不怕吃到上下文限制。
Fractal是一个开源CLI,可驱动Claude Code或Codex执行大型任务。它通过分层代理架构,允许一个代理将工作拆分给多个子代理,支持四层以上递归分解。在迁移任务中,顶级代理将工作分成多个大块,每个块由独立代理处理,若块过大则继续拆分。每个代理拥有独立git工作树并独立提交,支持断点续传。用户还可限制树深度、子代理数量、迭代次数和运行时间等预算。
Claude Code keeps quitting halfway through a migra…
Claude Code keeps quitting halfway through a migration I want to finish.
It finishes with a few files, but then it eats up its context window and hits a usage limit. It's not easy to pick the process back up from where it left off.
The thing with Claude Code and Codex: they are meant to run one job at a time. Everything the agent knows lives in a single running session, and there's a limit to how much it can hold.
Small tasks fit fine. Big tasks that split into twenty smaller tasks do not.
I've seen a few tools that let agents hand off work to helper agents, but those agents usually complete one task, return the result, and stop. They can't create helper agents of their own.
If your problem benefits from three or four layers, you are out of luck.
Fractal is an open-source CLI that solves this.
Fractal will drive Claude Code or Codex for you. You point it at a job, and it runs the agents, allowing each agent to hand off work to more agents as many levels down as the job needs.
This makes a huge difference!
1. For the migration, Fractal broke the job into a tree 2. A top agent split the work into a few big chunks 3. Each chunk became its own agent 4. If a chunk was too big, that agent split it again 5. Each agent planned, executed, reviewed, and committed the work 6. They repeated the cycle until the work was done 7. At that point, they moved their work back up the tree 8. At the end, all of the completed pieces were merged into the root job
Each agent gets its own git worktree and commits its changes as it goes, so multiple agents can work without overwriting each other.
This makes the process resumable: you can stop Fractal and start it again later without losing the work the agents have already completed.
By the way, you can set a strict budget for the agents. You can cap how deep the tree can go, how many children each agent can create, how many iterations it can run, and how long it can keep working.
All of this runs on your laptop. Nothing is hosted.
See GitHub Repository below.