taskflow

Commands

Pi slash commands and Codex MCP tools.

taskflow exposes the same operations two ways. On Pi, you type slash commands like /tf run and /tf:review-changes. On Codex (and Claude Code, OpenCode), the same operations are MCP tools the model calls — taskflow_run, taskflow_list, and so on.

This page is a grouped reference for both. Every command has a one-line purpose and, where useful, a concrete example. If you just want to skim, jump to the example session at the end.

Saved flows become CLI shortcuts on Pi (/tf:<name>). On MCP hosts, you run a saved flow by name through taskflow_run.

Pi /tf commands

The /tf command is the user-facing surface on Pi. Its subcommands fall into four groups.

Run

CommandDescription
/tf run <name> [args]Run a saved flow, optionally passing args as key=value pairs or JSON.
/tf:<name> [args]Shortcut — equivalent to /tf run <name> [args]. Registered for every saved flow.
/tf resume <runId>Resume a paused or failed run from where it stopped.

Inspect

CommandDescription
/tf listList all saved flows in this project.
/tf show <name>Print a saved flow's full JSON definition.
/tf runsBrowse recent run history (last 50) and pick one to inspect or resume.
/tf peek <runId> [phaseId]Inspect a stored run's intermediate phase output (post-hoc debugging). Supports --json, --item <n>, --limit <chars>.

Verify & analyze

CommandDescription
/tf verify <name>Statically verify a flow — cycles, missing deps, dead ends — at zero token cost.
/tf compile <name> [lr|td]Render the DAG as a Mermaid diagram (lr = left-right, td = top-down).
/tf ir <name>Compile to FlowIR + content hash (the incremental-recompute intermediate).
/tf provenance <runId>Show the observed read-set provenance for a run.
/tf why-stale <runId> [phaseId]Explain why a cached run is stale — which fingerprint input changed.
/tf recompute <runId> <phaseId> [--apply]Minimally recompute a stale phase. Default is a safe dry-run; --apply spends tokens.

Lifecycle

CommandDescription
/tf saveSave the most recent inline flow definition under a name (makes /tf:<name> available immediately).
/tf initConfigure model roles — map the built-in agent roles to your models.

peek, provenance, why-stale, and recompute are the debugging toolkit. Use them when a run did something unexpected and you need to see why without re-running it.

The taskflow tool (Pi)

On Pi, the model can also invoke a taskflow tool directly. It takes an action plus parameters. The actions mirror the /tf subcommands and add a few the model uses internally:

ActionDescription
runRun an inline or saved flow.
savePersist a flow definition.
resumeResume a run by runId.
listList saved flows.
agentsList the built-in agents.
verifyStatic check.
compileMermaid diagram + verification report.
ir / provenance / why-stale / recomputeIncremental recompute toolkit.
cache-clearClear the cross-run memoization cache.
initConfigure model roles.

Codex / Claude / OpenCode MCP tools

On MCP hosts, taskflow exposes these tools (the model calls them; you usually don't type them):

ToolDescription
taskflow_runRun an inline or saved flow; returns the final output and a runId.
taskflow_listList saved flows discoverable in this directory.
taskflow_showPrint a saved flow's definition.
taskflow_verifyStatically verify a flow (no execution).
taskflow_compileRender a flow as a DAG diagram (SVG image) plus a status line.
taskflow_peekInspect one phase's intermediate output from a stored run (post-hoc debugging).

On MCP hosts there is no /tf slash command — you describe the work in natural language and the model calls taskflow_run. Use taskflow_peek with the runId that taskflow_run returns when you need to inspect intermediate output.

An example session

A realistic session on Pi, from first run to debugging:

Author and verify a flow
/tf verify review-changes

Verify catches a cycle and a missing dependsOn before any tokens are spent. Fix the JSON, then run it:

Run the flow with an argument
/tf run review-changes dir=src

The run completes and returns the final summary. You like it, so save it:

Save it as a shortcut
/tf save review-changes

From now on, the shortcut works:

Run the saved flow
/tf:review-changes dir=src

A few days later the summary looks stale. Check why without re-running:

Diagnose staleness
/tf runs
/tf why-stale <runId> summary

why-stale reports that git:HEAD changed since the cached run. Recompute just that phase:

Minimally recompute the stale phase
/tf recompute <runId> summary --apply

Only summary re-runs; the rest of the flow is reused from cache.

Next

Last updated on

Was this helpful?

Help us improve the docs or ask a question in the community.

On this page