# fractal

Adopt this skill: https://proskills.md/skills/other/plasma-ai-fractal-fractal-skills-fractal

Page: https://proskills.md/skills/other/plasma-ai-fractal-fractal-skills-fractal
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: fractal/skills/fractal/SKILL.md
size: 41976
sha: 960002cc3f5011acf4aec5943f531ba226da31cb
upstream: https://github.com/plasma-ai/fractal/blob/main/fractal/skills/fractal/SKILL.md
truncated: true

```text
---
name: fractal
description: Hierarchical agent loops with recursive self-organization.
argument-hint: '[directive]'
disable-model-invocation: true
---

# Fractal

A fractal is a tree of autonomous agent loops, each in its own git worktree. A
node iterates toward a goal and can spawn child nodes that work subtasks in
parallel.

This skill configures a node with the user, then launches it in tmux or a
detached headless process group; from there it runs autonomously — iterating,
committing, and spawning children as needed.

Your role does not end at launch. The user (root) node has no loop of its own —
**you are it.** Once a node is running you are its *operator*: you watch the
tree, steer it, and relay between it and the user on their behalf. See
**Operator** below.

## Directive

`$ARGUMENTS` is a natural-language directive describing what this fractal should
do. Interpret it: distill the node's goal, and map anything the user pinned down
(a name, a budget, a model, limits, ...) onto the parameters below, each of
which becomes the matching `fractal node init` flag. The `/fractal` skill routes
all the configuration to `fractal node init` and passes only `--headless` (when
tmux is unavailable or the directive asks for it) and
`--continue`/`--clean`/`--drain` (when the directive asks to continue an
existing node) to `fractal node start` — plus `--max-cost` when it accompanies a
continue (a continue re-arms the cap at start, not init).

**Parameters** — all configuration. Set by `fractal node init`, written to
`config.json`, and editable there before launch:

- **`name`**: node name (required; letters, digits, and `_` only — no `-`)
- **`path`**: project root, repo root or monorepo sub-project (default: `.`)
- **`title`**: human-readable display name (default: de-slugged node name)
- **`scope`**: restrict commits to subdirectories within the worktree
  (comma-separated, e.g. `parent/child,tests`)
- **`base`**: branch to start from (default: current branch)
- **`meta`**: target node branch for meta-configuration
- **`inherit`**: seed surfaces from the parent node instead of the package seed
  (comma-separated: `steps`, `scripts`, `skills`, `config`, or `all`); 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
- **`template`**: template folder (`<path>[@<ref>]`) — any tracked folder
  holding `config.json`, read from git at the child's fork commit (or at
  `<ref>`) and recorded in the node's `_template.toml`. Its surfaces (`NODE.md`,
  `steps/`, `scripts/`, `skills/`, `agents/`) seed the node — a surface it lacks
  falls back to the inherit-or-package source, and `inherit` of a surface the
  template carries is refused — and its `config.json` preset fills each unset
  init parameter (an explicit parameter wins over the preset); a template
  charter's fill-sheet is validated at init
- **`include`** / **`exclude`**: template-relative paths to deploy or drop
  (repeatable; mutually exclusive; a directory entry covers its subtree),
  recorded in `_template.toml` so `node diff` and `node reseed` judge by the
  same effective set; only deployment outputs are selectable, and Jinja includes
  can still read excluded outputs and source-only `_partials/` fragments
- **`values`** / **`set`**: literal inputs for seed-time Jinja — the template's
  optional `_template.toml` holds `[values]` defaults, `values` names a TOML
  file whose top-level keys override those defaults, and `set` takes repeatable
  `KEY=<TOML literal>` pairs that win over the file. Use
  `--set 'role="reviewer"'` for text or `--set enabled=false` for a boolean;
  lists and tables replace whole input values. Supply required inputs before
  init; an input used by the rendered output must have a value
- **`pin`**: commission pin (a commit sha): must resolve, and every `pin:` line
  in the template charter must match it; also fills `{{pin}}`, overriding a
  template default but requiring agreement with an explicit values-file or set
  input
- **`agent`**: agent command; inherits the user node's default when omitted
- **`provider`**: provider route for the agent (e.g. `openrouter`); inherits the
  user node's default when omitted
- **`model`**: model override; when omitted, the agent uses its own default
  model
- **`effort`**: reasoning-effort override; when omitted, each agent seed's own
  pinned level applies, not the vendor default
- **`max-iters`**: per-run iteration cap
- **`max-depth`**: maximum child node nesting depth
- **`max-children`**: maximum direct child nodes
- **`max-descendants`**: maximum total descendant nodes
- **`timeout`**: per-run time limit (e.g. `30m`, `1.5h`)
- **`iter-timeout`**: per-iteration time limit (e.g. `30m`, `1.5h`)
- **`step-timeout`**: per-step time limit (e.g. `30s`, `10m`); caps each step
- **`step-retries`**: retries per failed step (default: `1`; `0` disables)
- **`step-retry-backoff`**: delay before each step retry (default: `10s`)
- **`interval`**: fixed iteration schedule (e.g. `1h`)
- **`sleep`**: delay between iterations (e.g. `10s`)
- **`wait`**: sleep between approval-wait sync invocations (default: `1m`)
- **`max-cost`**: cost ceiling in USD per run — runs are isolated, so each
  launch arms the cap anew; after a budget-ended run, `node start --continue`
  refuses without an explicit `--max-cost`
- **`max-iter-cost`**: per-iteration cost ceiling in USD
- **`max-step-cost`**: per-step cost ceiling in USD (warn-only when
  unenforceable)
- **`reserve-budget`**: budget reserved for cleanup; USD or N% of `max-cost`
  (default: 10%, which follows the cap when it changes); an explicit reserve —
  this flag, a template preset, or `config set` — keeps its figure when the cap
  changes, so pass `--reserve-budget` again to change it with the cap
- **`sync`**: enable (default) or disable radio sync before each step
- **`detached`**: run each step as a separate agent session (default: one
  continuous session)
- **`local`**: skip pushing to remote after each commit
- **`blind`**: subscribe to no radio channels (the parent still reads this node)
- **`sealed`**: seal the node's mailbox — its own seat cannot read hosted
  messages until an operator or the parent unseals it with
  `config set sealed=false` (the sealed seat cannot lift its own seal)

**Template authoring** — put prose and Jinja expressions in `NODE.md`, steps,
and included fragments such as `_partials/foundations.md`. Includes read the
same committed template bundle; to share one file across templates, include it
by a literal name from the repo root (`{% include '/campaign/DOCTRINE.md' %}`):
it reads at the template's commit and never deploys. Values are data: strings
containing `{{...}}` are never rendered again, and `$VAR` stays for runtime
rendering. The template's `_template.toml` supplies defaults; the node's
generated `_template.toml` records complete inputs, the source commit, and each
shared file's blob id. Parent edits to the rendered charter are ordinary text
edits. Editing recorded inputs is not a live update: `node diff` and bare
`node reseed` replay them, while an explicit `reseed --ref` or `--template` adds
defaults only for missing keys. Reseed preserves `NODE.md`, config, and memory,
so charter drift can remain.

**Start** — `fractal node start` just launches; all run parameters come from
`config.json`. A `max_cost` in `config.json` must be positive if set; a missing
`max_cost` launches uncapped with a loud warning. Its only arguments:

- **`--headless`/`--tmux`**: run the loop in a detached process group instead of
  a tmux session — output appends to `<node_dir>/headless.log`, one launch
  banner per launch. An unflagged launch reuses the backend the node last
  launched with; the flags and the seat-exported `FRACTAL_HEADLESS`
  (`true`/`false`, the parent's backend) force and re-record it
- **`--continue`**: continue a stopped/exited node — the launch 
```

## File: fractal/skills/fractal/agents/openai.yaml
size: 43
sha: 5b1f887a9138416870f64ba2fe21602e4a59cfa7
upstream: https://github.com/plasma-ai/fractal/blob/main/fractal/skills/fractal/agents/openai.yaml

```text
policy:
  allow_implicit_invocation: false
```

## File: README.md
upstream: https://github.com/plasma-ai/fractal/blob/main/README.md

````text
# fractal

[![license](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://github.com/plasma-ai/fractal/blob/main/LICENSE)
[![build](https://github.com/plasma-ai/fractal/actions/workflows/build.yaml/badge.svg)](https://github.com/plasma-ai/fractal/actions/workflows/build.yaml)
[![docs](https://github.com/plasma-ai/fractal/actions/workflows/docs.yaml/badge.svg)](https://github.com/plasma-ai/fractal/actions/workflows/docs.yaml)
[![lint](https://github.com/plasma-ai/fractal/actions/workflows/lint.yaml/badge.svg)](https://github.com/plasma-ai/fractal/actions/workflows/lint.yaml)
[![tests](https://github.com/plasma-ai/fractal/actions/workflows/tests.yaml/badge.svg)](https://github.com/plasma-ai/fractal/actions/workflows/tests.yaml)
[![codecov](https://codecov.io/gh/plasma-ai/fractal/branch/main/graph/badge.svg?token=FB0T12O2ZP)](https://codecov.io/gh/plasma-ai/fractal)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)

Hierarchical agent loops with recursive self-organization.

In a fractal, autonomous agent loops arrange themselves into a tree: a node
iterates toward a goal in its own `git worktree` and spawns child nodes for
separable subtasks, so the tree grows to fit the problem rather than a fixed
plan. Hard caps (iterations, depth, children, cost, time) keep each loop
bounded, and an operator can steer or stop it at any point. Run metadata
(including cost) lands in one local `SQLite` database, which can be interacted
with live in a terminal UI.

![fractal TUI dashboard](https://raw.githubusercontent.com/plasma-ai/fractal/main/docs/_static/tui.png)

> [!WARNING]
> **Nodes run their agent without permission prompts by default.** Unattended
> loops cannot stop to ask, so every seeded agent config disables the approval
> gate — Claude `bypassPermissions`, Codex `danger-full-access`, Grok
> `--always-approve`, opencode `--auto`, omp `--yolo`. A node can therefore run
> any command its agent decides to run, with your credentials and your machine's
> reach. The per-node `git worktree` isolates the *branch* it commits to, not
> the filesystem, the network, or anything else outside it. Only launch nodes
> whose task you would trust to run unsupervised, and prefer a sandboxed or
> otherwise disposable host for anything else.

______________________________________________________________________

**Source**:
[https://github.com/plasma-ai/fractal](https://github.com/plasma-ai/fractal)

**Package**:
[https://pypi.org/project/plasma-fractal/](https://pypi.org/project/plasma-fractal/)

**Documentation**:
[https://docs.plasma.ai/fractal](https://docs.plasma.ai/fractal)

______________________________________________________________________

## Installation

Install the `fractal` package from PyPI:

```bash
pip install plasma-fractal
```

or

```bash
pip install fractal
```

Use `pipx install` or `uv tool install` to install the package in an isolated
environment. If you use one of these two methods, you must also install
`plasma-wiki` (a plain `pip` install pulls `plasma-wiki` and puts `wiki` on your
`PATH`, but this is not the case when using `pipx install` or
`uv tool install`).

`uv tool install plasma-fractal --with-executables-from plasma-wiki` does the
same in one command.

Open the dashboard from your project root with `fractal open` (requires an
initialized fractal). Pass `--light` if your terminal uses a light color scheme.

### Skill

Install the skill for your agent via the plugin marketplace (Claude Code and
Codex):

```bash
# Claude Code
/plugin marketplace add plasma-ai/plugins
/plugin install fractal@plasma

# Codex
codex plugin marketplace add plasma-ai/plugins
codex plugin add fractal@plasma
```

Another install route is from the CLI, which copies (or symlinks) the fractal
and wiki skills into `~/.claude/skills` and `~/.agents/skills` (add `--project`
for the current project only):

```bash
fractal install [--link]
```

After upgrading the package, re-run `fractal install` to refresh the copied
skills (pass `--link` for symlinked install).

## Usage

A fractal is a tree of git worktrees, each running an autonomous agent loop. The
root (user) node is your current branch itself — it has no worktree or loop of
its own; top-level nodes branch from it, and child nodes branch from their
parent. Agents iterate in tmux sessions (or, with `--headless`, in detached
process groups), and all state (runs, iters, steps, costs, signals) is tracked
in a local SQLite database.

Five agent backends are supported — Claude Code (`claude`), Codex (`codex`),
Grok Build (`grok`), OpenCode (`opencode`), and Oh My Pi (`omp`) — selected per
node with `--agent` (children inherit it). Claude and Codex can additionally
route through OpenRouter with `--provider=openrouter`, which authenticates via
`OPENROUTER_API_KEY` from the launching shell; OpenCode and Oh My Pi reach
OpenRouter natively through their own `openrouter/<author>/<model>` model ids.

Use the `/fractal` skill to spawn and manage agent nodes. The `fractal` CLI is
also available directly — run `fractal --help` and `fractal <command> --help` to
explore.

The skill is invoked as `/fractal [directive]` and takes plain-language
instructions. The agent interprets the directive and prints any suggested
`NODE.md` instructions and completion requirement it can distill from the
directive, plus a table of every parameter (empty where the directive said
nothing), then asks for anything it could not infer. From there it walks you
through refining the node's definition and, once you approve, launches the node
in a tmux session. On hosts where tmux cannot run, add `--headless`; the node's
output appends to `headless.log`, delegated child starts follow the parent's
backend, and an unflagged relaunch reuses the backend the node last launched
with.

Parameters the skill interprets from the directive:

- **`name`**: node name (required; letters, digits, and `_` only — no `-`)
- **`path`**: project root, repo root or monorepo sub-project (default: `.`)
- **`title`**: human-readable display name (default: de-slugged node name)
- **`scope`**: restrict commits to subdirectories within the worktree
  (comma-separated, e.g. `parent/child,tests`)
- **`base`**: branch to start from (default: current branch)
- **`meta`**: target node branch for meta-configuration
- **`inherit`**: seed surfaces from the parent node instead of the package seed
  (comma-separated: `steps`, `scripts`, `skills`, `config`, or `all`); 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`**: agent command; inherits the user node's default when omitted
- **`provider`**: provider route for the agent (e.g. `openrouter`); inherits the
  user node's default when omitted
- **`model`**: model override; when omitted, the agent uses its own default
  model (Claude runs on the seed's `best` alias, or
  `anthropic/claude-sonnet-4.6` when routed through OpenRouter)
- **`effort`**: reasoning-effort override; when omitted, the Claude and Codex
  seeds' own pinned level (`high`) applies rather than the vendor default, while
  Grok, OpenCode, and Oh My Pi fall back to the vendor default
- **`max-iters`**: per-run iteration cap
- **`max-depth`**: maximum child node nesting depth
- **`max-children`**: maximum direct child nodes
- **`max-descendants`**: maximum total descendant nodes
- **`timeout`**: per-run time limit (e.g. `30m`, `1.5h`)
- **`iter-timeout`**: per-iteration time limit (e.g. `30m`, `1.5h`)
- **`step-timeout`**: per-step time limit (e.g. `30s`, `10m`); caps each step
- **`interval`**: fixed iteration schedule (e.g. `1h`)
- **`sleep`**: delay between iterations (e.g. `10s`)
- **`wait`**: sleep between approval-wait sync invocations (default: `1m`)
- **`max-cost`**: cost ceiling in USD per run — runs are isolated, 
````
