Set up
Build Maestro, then add the server from the repository root:ANTHROPIC_API_KEY in Claude Code’s environment, and the agents’ cost is billed to that key. To run agents on your Codex plan instead, add --runner codex to the server command.
The four tools
Workflow
Takes exactly one of:
script: the script text,scriptPath: a path to a script file,name: a workflow saved as.maestro/workflows/<name>.js.
args: the script’s arguments, as a JSON string.resumeFromRunId: resume that run. Without a script, the stored script and arguments are reused.cwd: run in another directory.
meta block, or a syntax error returns an error result at once; nothing starts.
WorkflowResult
With wait: true the call stays open until the run ends, so there is no need to poll. Claude Code moves a call that takes longer than two minutes to the background and delivers the result as a notification.
A finished run’s outcome is also on disk, so WorkflowResult answers for an old runId after the server has restarted. If the run was started with a cwd, pass the same cwd.
A one-shot claude -p session ends when its turn ends and does not wait for a background result. Use an interactive session to collect results.
Working on another repository
A run normally works in the directory the session was opened in. Thecwd input moves it:
- Agents work in that directory, and writers branch from its git repository.
- The run is stored under
<cwd>/.maestro. scriptPathis resolved against it.
cwd, or the run is not found.
Server options
The server takes--cwd, --state-dir, --tools-dir, --budget, --concurrency, --model, --runner, --structured-mode and --dry-run. See Command line.
--budget is one pool for the session: all runs the server starts spend from the same budget.
The server ends when Claude Code disconnects or exits. Runs in progress are stopped and can be resumed.
Your own tools
TheWorkflow tool’s description lists the custom tools found in .maestro/tools/, so the model writing a script knows their names. See Agents and tools.