<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/fractal-open-source-cli-that-gives-claude-code-and-codex-hierarchical-agent-loops-4pib6nmpp" -->

---
title: Fractal: open-source CLI that gives Claude Code and...
description: Fractal is an open-source CLI tool from Plasma that extends Claude Code and Codex with hierarchical, tree-structured agent loops. Instead of a single agent...
canonical: https://daily.dev/posts/fractal-open-source-cli-that-gives-claude-code-and-codex-hierarchical-agent-loops-4pib6nmpp
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Fractal: open-source CLI that gives Claude Code and Codex hierarchical agent loops | daily.dev
og:description: Fractal is an open-source CLI tool from Plasma that extends Claude Code and Codex with hierarchical, tree-structured agent loops. Instead of a single agent...
og:url: https://daily.dev/posts/fractal-open-source-cli-that-gives-claude-code-and-codex-hierarchical-agent-loops-4pib6nmpp
og:image: https://api.daily.dev/og/posts/4PIB6NMPP.png
og:image:alt: Fractal: open-source CLI that gives Claude Code and Codex hierarchical agent loops
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Fractal: open-source CLI that gives Claude Code and Codex hierarchical agent loops

**[Collections](https://daily.dev/sources/collections)** · 3 min read · 2 upvotes · 1 comments

## Summary

Fractal is an open-source CLI tool from Plasma that extends Claude Code and Codex with hierarchical, tree-structured agent loops. Instead of a single agent burning through its context window on large tasks, Fractal spawns a tree of agents where each handles a subtask via its own Prepare→Plan→Execute→Review→Commit cycle. Each agent gets an isolated git worktree to prevent conflicts, and all work is committed to normal git history, making runs resumable. Configurable depth, child count, and iteration limits are enforced, with all run data logged to a local SQLite database. It installs via pip, runs entirely locally, and is Apache 2.0 licensed.

## Content

## The problem with long coding sessions

Anyone who's tried to run Claude Code or Codex through a large migration has hit the same wall: the agent finishes a few files, burns through its context window, and stops. Picking up where it left off is awkward at best. The fundamental issue is architectural — each agent gets one context, one workspace, and one linear path through the problem. Small tasks fit fine. A migration that splits into twenty sub-tasks does not.

Some tools let agents hand off work to helper agents, but those helpers complete one task, return the result, and stop. They can't spawn helpers of their own. If your problem needs three or four layers of decomposition, you're stuck.

## What Fractal does

Plasma just open-sourced [Fractal](https://github.com/plasma-ai/fractal), a CLI tool that solves this by letting agent loops create more agent loops. It's Apache 2.0, runs entirely on your machine, and requires no hosted server.

The basic idea: instead of one agent trying to hold an entire large job in memory, Fractal turns the job into a tree. A top-level agent splits the work into chunks. Each chunk becomes its own agent. If a chunk is still too big, that agent splits it again. The tree grows into the shape of the actual problem rather than following a fixed plan.

Each node in the tree runs the same cycle — Prepare, Plan, Execute, Review, Commit — until its piece is done, then passes results back up. At the end, all the completed pieces merge into the root job.

## How it avoids the usual problems

Two things make this work in practice:

**Separate git worktrees.** Each agent owns its own working copy of the code, so multiple agents can work simultaneously without overwriting each other. Every iteration ends in a git commit, which means the entire run comes back as normal git history you can read line by line.

**Resumability.** Because agents commit as they go and state lives in a local SQLite database, you can stop Fractal mid-run and restart it later without losing completed work. The database also lets you watch costs and signals live.

You can also set hard limits: cap how deep the tree goes, how many children each agent can create, how many iterations it can run, and how long it can keep working. Useful if you don't want an autonomous agent running up an unexpected bill.

## A concrete example

For a large migration, the flow looks roughly like this:

1. Top agent splits the migration into a few big chunks
2. Each chunk runs as its own agent
3. Chunks that are still too large get split again
4. Each agent plans, executes, reviews, and commits its work
5. Completed work moves back up the tree
6. Everything merges at the root

Install with `pip install fractal`, then point it at a job.

## The broader pattern

This connects to something a separate workflow experiment surfaced: when an orchestrator handles planning, verification, and journaling while implementation agents handle the actual code, output quality improves noticeably. The tradeoff is higher token cost and longer runtime, so it's not something you'd use for every small task. But for large migrations, multi-service refactors, or anything that genuinely needs persistent ownership across separate branches, the architecture makes a real difference.

## Community discussion

Top comments from developers on daily.dev.

**@idoshamun** · 0 upvotes

> Now I'm curious 👀
>
> Though I do find `/goal` in codex to be relentless to achieve the goal, but never tried it for a big migration. Mostly for couple hours of work

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#claude-code](https://daily.dev/tags/claude-code)

[View this post on daily.dev](https://daily.dev/posts/fractal-open-source-cli-that-gives-claude-code-and-codex-hierarchical-agent-loops-4pib6nmpp)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Fractal: open-source CLI that gives Claude Code and Codex hierarchical agent loops","url":"https://daily.dev/posts/fractal-open-source-cli-that-gives-claude-code-and-codex-hierarchical-agent-loops-4pib6nmpp","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/fractal-open-source-cli-that-gives-claude-code-and-codex-hierarchical-agent-loops-4pib6nmpp"},"datePublished":"2026-07-22T14:46:32.530Z","dateModified":"2026-07-29T11:37:19.086Z","description":"Fractal is an open-source CLI tool from Plasma that extends Claude Code and Codex with hierarchical, tree-structured agent loops. Instead of a single agent...","isAccessibleForFree":true,"articleSection":"Collections","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Collections","logo":"https://media.daily.dev/image/upload/s--fk_6ycEi--/f_auto,q_auto/v1780996001/logos/collections?_a=BAMAMiWQ0","url":"https://daily.dev/sources/collections"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/fractal-open-source-cli-that-gives-claude-code-and-codex-hierarchical-agent-loops-4pib6nmpp","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"ai-agents,claude-code","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Collections","item":"https://daily.dev/sources/collections"},{"@type":"ListItem","position":3,"name":"Fractal: open-source CLI that gives Claude Code and Codex hierarchical agent loops"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/fractal-open-source-cli-that-gives-claude-code-and-codex-hierarchical-agent-loops-4pib6nmpp","comment":[{"@type":"Comment","text":"Now I’m curious 👀\nThough I do find /goal in codex to be relentless to achieve the goal, but never tried it for a big migration. Mostly for couple hours of work","datePublished":"2026-07-23T05:41:56.299Z","url":"https://daily.dev/posts/4PIB6NMPP#c-6BSLEzPWZ","author":{"@type":"Person","name":"Ido Shamun","url":"https://daily.dev/idoshamun","image":"https://media.daily.dev/image/upload/s---xy_OAwk--/f_auto,q_auto/v1703781380/avatars/avatar_28849d86070e4c099c877ab6837c61f0"}}]}
```

