Pi Dynamic Workflows Pi Dynamic Workflows, a new extension for the Pi AI assistant, enables users to run complex, multi-step tasks by having the model write a JavaScript script that distributes work across isolated subagents and synthesizes results. The tool, inspired by Anthropic's Claude Code dynamic workflows, supports codebase audits, multi-perspective reviews, and large refactors, with live progress tracking and cancellation capabilities. Claude-Code-style dynamic workflows for Pi . A Pi extension that adds a workflow tool. Instead of one assistant doing everything sequentially, the model writes a small JavaScript script that fans out the work across many isolated subagents, then synthesizes the results. Great for codebase audits, multi-perspective review, large refactors, and fan-out research. Inspired by Anthropic's dynamic workflows in Claude Code https://claude.com/blog/introducing-dynamic-workflows-in-claude-code . pi install npm:pi-dynamic-workflows or from a local checkout pi install /path/to/pi-dynamic-workflows Then in Pi: /reload That's it. The extension registers a workflow tool and activates it on session start. Just ask Pi for a workflow in plain language: Run a workflow to inspect this repository and summarize the main modules. The model will write a workflow script and call the workflow tool. Live progress shows up inline: ◆ Workflow: inspect project 3/3 done ✓ Scan 1/1 1 ✓ repo inventory ✓ Analyze 2/2 2 ✓ source modules 3 ✓ final summary Press Esc to cancel a running workflow. Active subagents are aborted and surfaced as skipped. A workflow is plain JavaScript. The first statement must export literal metadata. name and description are required; phases is optional documentation for an expected outline. The live progress view is driven by phase ... calls at runtime: js export const meta = { name: 'inspect project', description: 'Inspect a repository and summarize the main modules', phases: { title: 'Scan' }, { title: 'Analyze' }, , } phase 'Scan' const inventory = await agent 'Inspect the repository structure.', { label: 'repo inventory', } phase 'Analyze' const summary = await agent 'Summarize the main modules from this inventory:\n' + inventory, { label: 'module summary' }, return { inventory, summary } Phases are discovered as the script runs, so conditional and loop-created phases work naturally. If a branch is skipped, its phase does not show up as an empty progress row. Reusable workflow files can opt into editor hints for workflow globals: ///