{"slug": "show-hn-fractal-recursive-agent-loops-for-complex-multi-step-work", "title": "Show HN: Fractal – recursive agent loops for complex, multi-step work", "summary": "Plasma AI released Fractal, an open-source tool that uses recursive agent loops organized in a tree of git worktrees to autonomously decompose and complete complex, multi-step tasks. Each node iterates toward a goal, spawns child nodes for separable subtasks, and is bounded by hard caps on iterations, depth, children, cost, and time, with all run metadata stored in a local SQLite database accessible via a terminal UI. The tool supports five agent backends—Claude Code, Codex, Grok Build, OpenCode, and Oh My Pi—and is available on PyPI as the 'plasma-fractal' package.", "body_md": "Hierarchical agent loops with recursive self-organization.\n\nIn a fractal, autonomous agent loops arrange themselves into a tree: a node\niterates toward a goal in its own `git worktree`\n\nand spawns child nodes for\nseparable subtasks, so the tree grows to fit the problem rather than a fixed\nplan. Hard caps (iterations, depth, children, cost, time) keep each loop\nbounded, and an operator can steer or stop it at any point. Run metadata\n(including cost) lands in one local `SQLite`\n\ndatabase, which can be interacted\nwith live in a terminal UI.\n\n**Source**:\n[https://github.com/plasma-ai/fractal](https://github.com/plasma-ai/fractal)\n\n**Package**:\n[https://pypi.org/project/plasma-fractal/](https://pypi.org/project/plasma-fractal/)\n\n**Documentation**:\n[https://docs.plasma.ai/fractal](https://docs.plasma.ai/fractal)\n\nInstall the `fractal`\n\npackage from PyPI:\n\n```\npip install plasma-fractal\n```\n\nor\n\n```\npip install fractal\n```\n\nUse `pipx install`\n\nor `uv tool install`\n\nto install the package in an isolated\nenvironment. If you use one of these two methods, you must also install\n`plasma-wiki`\n\n(a plain `pip`\n\ninstall pulls `plasma-wiki`\n\nand puts `wiki`\n\non your\n`PATH`\n\n, but this is not the case when using `pipx install`\n\nor\n`uv tool install`\n\n).\n\n`uv tool install plasma-fractal --with-executables-from plasma-wiki`\n\ndoes the\nsame in one command.\n\nOpen the dashboard from your project root with `fractal open`\n\n(requires an\ninitialized fractal). Pass `--light`\n\nif your terminal uses a light color scheme.\n\nInstall the skill for your agent via the plugin marketplace (Claude Code and Codex):\n\n```\n# Claude Code\n/plugin marketplace add plasma-ai/plugins\n/plugin install fractal@plasma\n\n# Codex\ncodex plugin marketplace add plasma-ai/plugins\ncodex plugin add fractal@plasma\n```\n\nAnother install route is from the CLI, which copies (or symlinks) the fractal\nand wiki skills into `~/.claude/skills`\n\nand `~/.agents/skills`\n\n(add `--project`\n\nfor the current project only):\n\n```\nfractal install [--link]\n```\n\nAfter upgrading the package, re-run `fractal install`\n\nto refresh the copied\nskills (pass `--link`\n\nfor symlinked install).\n\nA fractal is a tree of git worktrees, each running an autonomous agent loop. The root node branches from your working tree, and child nodes branch from their parent. Agents iterate in tmux sessions, and all state (runs, iters, steps, costs, signals) is tracked in a local SQLite database.\n\nFive agent backends are supported — Claude Code (`claude`\n\n), Codex (`codex`\n\n),\nGrok Build (`grok`\n\n), OpenCode (`opencode`\n\n), and Oh My Pi (`omp`\n\n) — selected per\nnode with `--agent`\n\n(children inherit it). Claude and Codex can additionally\nroute through OpenRouter with `--provider=openrouter`\n\n, which authenticates via\n`OPENROUTER_API_KEY`\n\nfrom the launching shell; OpenCode and Oh My Pi reach\nOpenRouter natively through their own `openrouter/<author>/<model>`\n\nmodel ids.\n\nUse the `/fractal`\n\nskill to spawn and manage agent nodes. The `fractal`\n\nCLI is\nalso available directly — run `fractal --help`\n\nand `fractal <command> --help`\n\nto\nexplore.\n\nThe skill is invoked as `/fractal [directive]`\n\nand takes plain-language\ninstructions. The agent interprets the directive and prints any suggested\n`NODE.md`\n\ninstructions and completion requirement it can distill from the\ndirective, plus a table of every parameter (empty where the directive said\nnothing), then asks for anything it could not infer. From there it walks you\nthrough refining the node's definition and, once you approve, launches the node\nin a tmux session.\n\nParameters the skill interprets from the directive:\n\n: node name (required; letters, digits, and`name`\n\n`_`\n\nonly — no`-`\n\n): project root, repo root or monorepo sub-project (default:`path`\n\n`.`\n\n): human-readable display name (default: de-slugged node name)`title`\n\n: restrict commits to subdirectories within the worktree (comma-separated, e.g.`scope`\n\n`parent/child,tests`\n\n): branch to start from (default: current branch)`base`\n\n: target node branch for meta-configuration`meta`\n\n: seed surfaces from the parent node instead of the package seed (comma-separated:`inherit`\n\n`steps`\n\n,`scripts`\n\n,`skills`\n\n,`config`\n\n, or`all`\n\n); agent config always inherits. A top-level spawn's parent is the user node, which carries no steps, scripts, or skills — the parameter is for configured nodes spawning children: agent command; inherits the user node's default when omitted`agent`\n\n: provider route for the agent (e.g.`provider`\n\n`openrouter`\n\n); inherits the user node's default when omitted: model override; when omitted, the agent uses its own default model`model`\n\n: reasoning-effort override; when omitted, each agent seed's own pinned level applies, not the vendor default`effort`\n\n: per-run iteration cap`max-iters`\n\n: maximum child node nesting depth`max-depth`\n\n: maximum direct child nodes`max-children`\n\n: maximum total descendant nodes`max-descendants`\n\n: per-run time limit (e.g.`timeout`\n\n`30m`\n\n,`1.5h`\n\n): per-iteration time limit (e.g.`iter-timeout`\n\n`30m`\n\n,`1.5h`\n\n): per-step time limit (e.g.`step-timeout`\n\n`30s`\n\n,`10m`\n\n); caps each step: fixed iteration schedule (e.g.`interval`\n\n`1h`\n\n): delay between iterations (e.g.`sleep`\n\n`10s`\n\n): sleep between approval-wait sync invocations (default:`wait`\n\n`1m`\n\n): cost ceiling in USD per run — runs are isolated, so each launch arms the cap anew; after a budget-ended run,`max-cost`\n\n`node start --continue`\n\nrefuses without an explicit`--max-cost`\n\n: per-iteration cost ceiling in USD`max-iter-cost`\n\n: per-step cost ceiling in USD (warn-only when unenforceable)`max-step-cost`\n\n: budget reserved for cleanup; USD or N% of`reserve-budget`\n\n`max-cost`\n\n(default: 10%): enable (default) or disable radio sync before each step`sync`\n\n: run each step as a separate agent session (default: one continuous session)`detached`\n\n: skip pushing to remote after each commit`local`\n\nRun `install.sh`\n\nin the package root. With no environment active it creates and\nuses a local `.venv`\n\n; with one active (e.g. pyenv) it installs into that\nenvironment (editable), without recreating it:\n\n```\n./install.sh --all-extras --groups=test,lint,type\n```\n\nRun `./install.sh --help`\n\nfor all options. Alternatively, run\n`uv sync --all-extras --group test --group lint --group type`\n\nand\n`uv run pre-commit install`\n\nto set up the environment manually.\n\nInstalling a dependency as editable (e.g. a sibling package) is left to the\ncaller: `uv pip install --editable <path>`\n\n.\n\nWith an editable install, `fractal install --link`\n\nsymlinks the bundled skill\ninto the agent skill directories instead of copying it, so skill edits apply\nwithout re-running the install.\n\nOnce installed, run tools with `uv run --no-sync <command>`\n\n, or activate the\nenvironment first (`source .venv/bin/activate`\n\n).\n\nRun the test suite:\n\n```\npytest .\n```\n\nThe suite runs with `--doctest-modules`\n\nenabled, and the integration tests\ncreate real git repositories and worktrees.\n\nRun linters and formatters:\n\n```\npre-commit run --all-files\n```\n\nThe contribution workflow, repository conventions, and release process (version sources, tagging, CI guard) are documented in:\n\n- Contribution workflow (organization-wide):\n[CONTRIBUTING.md](https://github.com/plasma-ai/.github/blob/main/CONTRIBUTING.md) - Repository conventions:\n[AGENTS.md](https://github.com/plasma-ai/fractal/blob/main/AGENTS.md) - Release process (organization-wide):\n[RELEASING.md](https://github.com/plasma-ai/.github/blob/main/RELEASING.md)\n\nLicensed under the Apache License 2.0 — see\n[LICENSE](https://github.com/plasma-ai/fractal/blob/main/LICENSE).\n\nCopyright © 2026 Plasma AI", "url": "https://wpnews.pro/news/show-hn-fractal-recursive-agent-loops-for-complex-multi-step-work", "canonical_source": "https://github.com/plasma-ai/fractal", "published_at": "2026-07-21 18:35:21+00:00", "updated_at": "2026-07-21 18:42:58.378108+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "artificial-intelligence"], "entities": ["Plasma AI", "Fractal", "Claude Code", "Codex", "Grok Build", "OpenCode", "Oh My Pi", "OpenRouter"], "alternates": {"html": "https://wpnews.pro/news/show-hn-fractal-recursive-agent-loops-for-complex-multi-step-work", "markdown": "https://wpnews.pro/news/show-hn-fractal-recursive-agent-loops-for-complex-multi-step-work.md", "text": "https://wpnews.pro/news/show-hn-fractal-recursive-agent-loops-for-complex-multi-step-work.txt", "jsonld": "https://wpnews.pro/news/show-hn-fractal-recursive-agent-loops-for-complex-multi-step-work.jsonld"}}