pi-workflows-claude

Claude-Code-style workflow engine for pi: a Workflow tool that runs deterministic JavaScript orchestration scripts (agent/parallel/pipeline/phase) with resume, journaling, phases, permissions and a live web UI.

Packages

Package details

extension

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

$ pi install npm:pi-workflows-claude
Package
pi-workflows-claude
Version
0.2.0
Published
Oct 7, 2026
Downloads
170/mo · 14/wk
Author
noext12
License
MIT
Types
extension
Size
262.2 KB
Dependencies
0 dependencies · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

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

README

pi-workflows-claude

A pi extension that reproduces Claude Code's workflow-script engine: a workflows-claude tool that runs a deterministic JavaScript orchestration script which spawns subagents through agent() / parallel() / pipeline() / phase() — with resume caching, an append-only journal, per-workflow permissions, a /workflows-claude TUI and a live web UI.

pi install npm:pi-workflows-claude        # or: pi install git:github.com/Noext/pi-workflows

What you get

workflows-claude tool { script | name | scriptPath, args, resumeFromRunId } — validates, compiles, launches in the background, returns a run handle
Script API export const meta = { name, description, phases } + agent(), parallel(), pipeline(), phase(), log(), args, budget, nested workflow() (one level)
Resume chained v2:sha256 cache keys → the longest unchanged prefix of agent() calls replays from journal.jsonl instantly
Per-agent control label, phase, model, effort (off→max), schema (structured output), agentType, isolation: 'worktree', stallMs
Permissions deny > ask > allow per workflow name from ~/.pi/agent/workflows-claude.json / <repo>/.pi/workflows-claude.json, default ask with a dialog showing the script
Commands /workflows-claude list|show|kill|pause|skip|retry|stats|export|compare|replay|config|permissions|purge|web, plus one command per discovered workflow
Web UI /workflows-claude web [port] [lan] — SSE-live phase tree, agent drawers (prompt/result/journal), Pause/Kill/Skip/Retry from the browser
Bundled workflows code-review, deep-research

Configuration

// ~/.pi/agent/workflows-claude.json
{
  "defaultModel": "anthropic/claude-sonnet-4-5",
  "defaultEffort": "high",
  "permissions": { "deny": ["deploy-*"], "ask": ["code-review"], "allow": ["*"] }
}

PI_WORKFLOW_MODEL / PI_WORKFLOW_EFFORT override the file, the project file overrides the user file, and an unknown value warns once and degrades gracefully. Headless runs (pi -p) refuse an unanswered ask, so add an allow rule for unattended workflows.

Environment: PI_WORKFLOW_AGENT_TOOLS (child tool allowlist), PI_WORKFLOW_WEB_PORT / PI_WORKFLOW_WEB_HOST / PI_WORKFLOW_WEB_TOKEN / PI_WORKFLOW_WEB_ROOTS (the web UI, which starts with every session and binds the LAN by default — PI_WORKFLOW_WEB_PORT=0 turns it off, webRoots in the config adds roots to serve besides the session's own).

Script example

export const meta = {
  name: 'audit',
  description: 'Find issues, then adversarially verify them',
  phases: [{ title: 'Find' }, { title: 'Verify' }],
}
const found = await parallel(ANGLES.map((a) => () =>
  agent(a.prompt, { phase: 'Find', schema: BUGS, effort: 'high' })))
const confirmed = await parallel(found.filter(Boolean).flatMap((r) => r.bugs).map((b) => () =>
  agent(`Refute: ${b.title}`, { phase: 'Verify', schema: VERDICT })))
return confirmed.filter(Boolean).filter((v) => v.isReal)

Iterate without re-running everything: keep the returned scriptPath, edit it, then call workflows-claude({ scriptPath, resumeFromRunId }).

Links

MIT licensed (see the repository for details).