pi-agent-flow

Flow-state transition extension for Pi coding agent.

Packages

Package details

extension

Install pi-agent-flow from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-agent-flow
Package
pi-agent-flow
Version
2.3.8
Published
Jun 19, 2026
Downloads
10.5K/mo · 1,278/wk
Author
tuanhung303
License
MIT
Types
extension
Size
1.9 MB
Dependencies
2 dependencies · 5 peers
Pi manifest JSON
{
  "extensions": [
    "./dist/index.js"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

Pi Agent Flow 🌊


Why This Exists

Long conversations can get messy—context bloats, tool calls get duplicated, and the real signal gets lost in the noise. Pi Agent Flow solves this by forking each task into a focused, isolated child process with only the context it actually needs.

The parent stays clean; the workers stay focused.

  • No more duplicate work: Skip re-running the same read or grep commands.
  • Keep it clean: Your main conversation thread stays free from endless transcripts.
  • Laser focus: Each flow locks onto its intent without getting distracted by past messages.
  • Run in parallel: Batch multiple tasks concurrently and get clean, structured results back.
  • Instant quick actions: Use trace or dispatch parameters to execute reads, writes, edits, or bash commands in one round-trip step without extra model latency.

See it in Action

Quickstart

Install the extension via the Pi CLI:

pi install npm:pi-agent-flow

Then, jump right in and transition tasks in parallel:

pi
{ "flow": [
  { "type": "scout", "intent": "Map auth code", "aim": "Find JWT logic" },
  { "type": "audit", "intent": "Audit auth module", "aim": "Security audit" }
] }

Pro tip: You can also add { "packages": ["npm:pi-agent-flow"] } to your ~/.pi/agent/settings.json file.

Developing this extension locally

If pi loads npm:pi-agent-flow from ~/.pi/agent/npm, rebuilds do not apply until you sync:

git clone https://github.com/tuanhung303/pi-agent-flow.git
cd pi-agent-flow
npm run verify:pi

verify:pi runs trace/flow UI regression tests and copies dist/ + agents/ into the pi npm install. Use npm run check:dist in CI or before PRs to block legacy -----/max context placeholders in dist/.

Deep Dive

Want to learn more? Check out our docs:

  • Core Flows: Understand specialist workers (scout, build, debug, etc.).
  • Custom Flows: Build your own specialized flows.
  • Tools: Unified batching, web search, and interactive prompts.
  • Structured Output: Learn about the clean JSON results you get back.
  • Configuration: CLI flags, env vars, and slash commands.