agent-graph-flow
New in 0.31: resumable runs with approval, and Code Mode

Ants don't have a CEO.

Still, each one knows what to do: it follows the trail the others left. agf does the same for your AI agents. It's called stigmergy.

agf (agent-graph-flow) is a free, open-source command-line tool that organizes the work of AI coding agents such as Claude Code, Copilot and Codex. It splits the request into tasks, hands the agent one at a time and only accepts a task as done when a test proves it works. Everything runs on your computer. The principle is stigmergy: each agent records what it did, and the next one picks up from there.

$curl -fsSL https://graph-flow.cloud/install.sh | bash

macOS, Linux and Windows · runs on your computer, no Docker · Open source, Apache-2.0 license

agf 0.31 architecture diagramSee how the parts fit together →

The idea

Why ants

No single ant knows where the food is. When one finds a good path, it leaves a scent on it. The others follow the scent, and the scent on bad paths fades. With nobody giving orders, the colony ends up on the best path.

AI agents are the same: none of them knows in advance what will work in your project. agf records what worked and what didn't, so the next agent starts out knowing.

In the colony
In agf
An ant goes out for food
An agent takes a task
It marks the path that worked
agf done records the task that passed its tests
The scent on bad paths fades
agf learning route gives less weight to what failed
The colony finds the best path
agf learning stats shows what works best
The colony notices when something is wrong
agf colony-health gives a grade from A to F
The food runs out and they move on
agf harness --saturation shows where improving pays off now

Only what a test proved counts as a success, not what the agent said. Picking the next task by the path that worked best is optional (agf next --aco); without it, priority decides.

How it works

01

Plan

The request becomes a list of small tasks, each with a clear definition of done.

02

Build

The agent takes a task, writes the test, then the code, and closes the task when the test passes.

03

Harden

agf harness grades the project's quality and points to what to fix first.

Guarantees

What agf won't let through

01

Code without a task

Every change is tied to a recorded task. You can always tell why a line exists.

02

Two tasks at once

Each agent does one task at a time. agf next hands over the next one when the current one closes.

03

Code before the test

The test comes first and has to fail. Only then comes the code that makes it pass.

04

Done in name only

A task closes when the code and the test exist and the test passes. Saying it's finished isn't enough.

05

Shortcuts without a reason

Closing a task while skipping the checks requires a reason, and agf records who did it and why.

What's new

What changed in version 0.31

0.31 brings step-by-step runs that resume where they stopped and wait for your approval, scheduling, Code Mode to spend fewer tokens on tools, and per-tool MCP control. Gates got fast: closing a task takes under a minute.

Picks up where it stopped

Splits the work into steps and saves each one in the local database. If it stops halfway, it restarts from the last finished step.

agf checkpoint run <steps.json>

Asks for your approval midway

A step can stop and wait for a person. You approve or deny, and the run goes on or ends there.

agf approve <run> --reason "ok"

Runs on its own schedule

Schedules prompts and runs on a timetable (cron) or on a signed HTTP call.

agf schedule add "0 9 * * *" "<prompt>"

Spends fewer tokens on tools

The agent writes a small program that calls several tools at once, in an isolated sandbox with no network or files.

agf codemode run <tools.json> "<code>"

Controls each MCP tool

For each tool you decide: allow, block or ask first. Adding an MCP server shows the command and asks you to confirm.

agf mcp add <server>

Compares models on the same work

Runs a large model and a small one on the same task and shows each one's accuracy and cost.

agf eval --arena

Closes a task in under a minute

Quality gates now have a fixed time budget: closing a task fits in 40 s, and pushing code, which took 22 min, now takes under a minute.

agf done <id>

Builds the whole release on one server

The macOS and Linux binaries and the Windows bundles come out of the same server, with macOS already signed.

agf upgrade

Architecture

How the parts fit together

An interactive diagram follows one task: from your request to the agent, from the agent to agf, and from the quality gates to the task graph.

Open the diagram →
agf 0.31 architecture diagram

Getting started

From zero to your first finished task

Install and go. There's no config file to write.

Run agf on its own to see the welcome screen.

agf · bash
$ agf init
# sets up the project

$ agf import-prd docs/prd.md
# creates the tasks from a document

$ agf start
# takes the next task

$ # failing test -> code -> passing test
# the agent does the task

$ agf done <id>
# checks and closes the task

$ agf metrics
# shows what each task cost in tokens

$ agf harness
# grades the quality

See it work

From install to your first finished task in 70 seconds

Narrated video (in Portuguese): install, create the tasks, write the test, make it pass and close the task.

Cost

What each task cost

agf records every AI call: which task, how many tokens and what it cost. agf metrics shows the cost per task, agf metrics --simulate shows what it would cost with another model and agf savings shows how much you saved.

By default your agent is the one calling the AI, not agf. So agf spends nothing, and seeing few recorded costs is normal. Every saving shown says whether it was measured or estimated.

agf dashboard showing token savings, measured and estimated

No need to take our word for it: the code is open.

agf is open source (Apache-2.0). It doesn't send your data and doesn't identify your machine, and an automated test guarantees it. Download it, check it and use it anywhere.

Read the code →

Install in seconds

Download agf

On macOS and Linux, agf is a single program: no Node, npm or Docker needed. On Windows it runs on Node (version 22 or 24), because companies often block unsigned .exe programs.

macOS

Install with one command:

Linux

Install with one command:

Windows

Install with one command:

macOS: the program isn't signed, and the installer unblocks the file itself. If you download it by hand, check the .sha256 file.

After downloading

1. Allow the file to run
macOSchmod +x agf-darwin-arm64
Linuxchmod +x agf-linux-x64
WindowsNeeds Node 22 or 24. The installer also removes old versions (agf.exe).
2. Check the file is intactshasum -a 256 agf-darwin-arm64The result must match the .sha256 file.
3. Try the program./agf --versionShows the installed version.
4. Use it in your projectInside your project, run agf init. It sets up the project and the instructions for your agent.agf init