Pi Team Mode
Team Mode puts a Team Lead in the foreground and runs useful work in background Pi workers. Engineer is on by default in the interactive TUI. Its stock Lead coordinates workers individually—no meetings. This is profile behavior, not an Engineer-specific permission rule. A routine fix can use one worker to investigate, edit and verify; larger jobs use dependencies and parallel workers as needed.
0.1.7 adds optional skill indexes to worker roles without changing dispatch backends or the native Agents display. 0.1.6 adds live worker models to Status, remembers the selected profile per Pi session, and shows live scheduler counts in the footer. 0.1.5 introduced padded role badges and removed the duplicate queue acknowledgement. 0.1.4 was not published to npm.
0.1.3 adds personal profiles, template-based creation, and a Team Mode menu. As in 0.1.2, compatible stock subagents show Team role badges and task briefs in the native Agents rows. Team generates definitions on first dispatch; SDK-only installs still work without stock subagents.
Install
The extension targets Pi 1.7.0. Install the npm release with pi install npm:pi-team-mode; uninstall it with pi remove npm:pi-team-mode.
Alternatively, install the GitHub default branch with pi install git:github.com/flaminigo/pi-team-mode and remove it with pi remove git:github.com/flaminigo/pi-team-mode. For a local checkout use pi install "$PWD" and pi remove "$PWD" from the repository root. The root Pi package loads tracked TypeScript; Git and local root installs do not require dist/ or a manual build. See the user manual for examples.
This nested directory is the npm packaging target. If installing it directly from a checkout instead of the root, run npm ci && npm run build here first, then pi install "$PWD". Use --local on both Pi install and remove for a project-scoped registration. Restart Pi or use /reload after changing the installation.
On fresh TUI startup, an unpinned, Pi-managed install from the official GitHub repository checks whether main is ahead of the installed commit. The read-only check runs in the background, times out after two seconds, and stays silent offline, on failure, and for local, pinned, or npm sources. PI_TEAM_NO_UPDATE_CHECK=1 disables this check, not Pi’s own package notice; pi --offline disables both.
Use pi update npm:pi-team-mode for npm installs or pi update git:github.com/flaminigo/pi-team-mode for GitHub installs to update just Team Mode, then /reload or restart Pi. Run it from the trusted project for project-scoped installs (--approve if trust isn’t saved). On Pi 1.7, pi update --extensions updates all packages and pi update updates Pi itself; pi upgrade --extensions is not valid. For this nested local checkout, rebuild after changing source, then reload. If pi list already shows the repository root, /reload or a restart reads the working-tree TypeScript without a build or reinstall. To switch sources, remove the old source in its original scope before installing the checkout.
Open /team → Status or run /team status for the same read-only view. It keeps the selected profile, on/off or blocked state, and task IDs and states (including settled tasks). The Live workers section lists queued, starting, and running Team jobs on either backend, showing the configured role, task ID, brief preview, and the exact provider/model-id once the worker starts. Before then it shows pending (with the pin if explicit), or inherits foreground at start when the queued job is set to inherit. Use ↑/↓ or j/k to scroll and Esc to close. Opening the view does not make model requests. The dispatch transcript still shows only the padded role badge, brief and background for each task; the Lead still receives the original queue result.
With stock @tintinweb/pi-subagents 0.26.3, Team creates real Markdown definitions on first dispatch, including for configured profiles and roles. The native Agents row shows the role badge (red Validator) and the brief. The worker receives the current role prompt instead of inheriting Lead's. Team keeps the definitions in <Pi agent directory>/team-mode-workers/ with flat namespaced links agents/pi-team-mode-worker-<profile>-<role>-<unique-id>.md. Stock 0.26.3 reads only direct *.md children in personal agents/, workspace .agents/agents/ and project .pi/agents/, and in package manifest-declared directories. Manifest-declared individual nested files are supported, not recursive discovery. Team keeps its existing flat registrations and does not create package manifests or change stock discovery settings. It reuses matching Team-owned definitions without rewriting them. Changed content or a name collision gets a new identity; existing definitions are left intact. Team does not change stock settings or clean up generated definitions on uninstall.
Extension-registered models: Stock 0.26.3 inherits the foreground Pi model runtime. Except for Cursor (below), SDK workers replay only the selected provider's Pi registration (including its stream/auth callbacks) in their own runtime; they use Pi's normal auth configuration and do not reload extensions or copy session-only credentials. This supports providers whose registrations work without child extension lifecycle hooks. Team reports an unregistered provider, an unlisted model, or an unavailable model without choosing a substitute.
Explicit tool allowlists, SDK continuations, and unavailable native definitions use Pi SDK child sessions without an Agents row. Except for Cursor, model and thinking settings do not by themselves change routes on a compatible build. SDK workers use core Pi tools, not foreground extensions. The adapter uses a compact handoff when upstream cannot resume a finished job; SDK sessions can continue a handful of recent tasks. /team doctor reports backend availability, not exact definition resolution. Stock RPC cannot verify definition ownership or disable fallback per call. Team checks for existing claims before dispatch and reports a mismatched run type, but stock cannot guarantee safety against a concurrent file change.
Cursor workers
To use a Cursor model for an unrestricted role, select its exact cursor/<model-id> in /team model or in that role’s model pool. Team requires npm:pi-cursor-sdk to be enabled, installed, and configured in Pi’s user settings or in a project Pi has trusted. Team does not install it, accept a task-supplied extension path, or reload unrelated extensions. The selected model must be in the worker’s own Cursor catalog and usable with Pi’s configured Cursor authentication. Team does not fall back to another model.
Cursor workers always use the Pi SDK, even with stock subagents available. Each worker owns its Cursor extension binding and model runtime; cancellation and recent-task continuation work through Team. These workers appear in Team’s dispatch and results, not in the native Agents hierarchy. Compatibility with pi-cursor-sdk 0.5.32 was verified offline without real auth or Cursor requests.
Cursor’s native tools and ambient MCP configuration are separate from Pi’s tool list. Team fails closed for roles with an explicit access.tools allowlist rather than running a Cursor worker that could exceed it. In a project Pi does not trust, start Pi with PI_CURSOR_SETTING_SOURCES=none to prevent Cursor from loading ambient settings. Team does not change Cursor settings or process environment for you.
Use
/team opens the Team Mode menu: Switch profile, Create profile from template, Turn Team Mode off/on, Status, Configure role model, and Help. Navigate with ↑/↓ and Enter; Esc closes the current picker. /team profile opens the profile-ID picker directly. /team help lists all commands.
/team profile <id> switches directly and turns Team Mode on. /team profile status only switches if a custom profile has that ID; for status use /team status.
/team on, /team off, /team status, /team cancel, /team reset, /team doctor.
/team profile create <id> --from <template> saves a personal copy without switching or changing the default. The Create profile from template menu item prompts for the template and new ID, saves, then asks Switch to the new profile?. No or Esc at that final question leaves the copy saved but does not switch.
/team config edit [project], /team config validate, /team config reload.
- Configure role model or
/team model opens a role picker, then an available-model picker; /team model <role> opens just the latter. /team model <role> <provider/model-id> (or configured alias) adds an available model to the role's pool and selects it for the next worker run (or switches the foreground Lead now, if Team Mode is on). Usage is tracked locally for five-entry pool eviction. Menus, pickers, and config editing do not prompt outside the TUI.
The last explicitly selected profile is remembered in the current Pi session and restored on /reload or resume against the latest configuration. A new session, or one whose selected profile is no longer available, uses the configured default. Pi does not create a session file until there is a user or assistant message; --no-session choices stay in memory. The on/off setting for a reopened session still comes from config. Jobs and worker activity are not restored or replayed.
The footer shows the active profile and live counts: queued, starting, confirmed running, stopping, and outcomes. Outcome counts stay until you reset, change profiles, reload, or turn Team Mode off. Only SDK-reported Pi tools contribute to the optional using tools count. Stock RPC reports its lifecycle without guessing at tool use or thinking; neither backend infers thinking from model settings.
Team Mode ships a read-only catalog: engineer_template, research_template, audit_template. These IDs are for copying, not switching. On interactive activation (including /reload), Team saves only missing personal engineer, research, and audit profiles as JSON in <Pi agent directory>/team-mode-profiles/. Saved profiles are full copies; inline personal entries (including sparse ones) count as existing profiles and are never rewritten by seeding. The effective order is built-in fallback → full personal files by ID → inline team-mode.json → trusted .pi/team-mode.json. Personal files do not inherit later template changes. If a starter file is removed and no inline entry exists, the next interactive activation backfills it again.
Seed and create require valid personal settings on their own and as merged in the current workspace. Create refuses existing runnable IDs, including trusted project IDs, and never copies merged project settings. IDs for new files are 1–64 lowercase letters, digits, underscores or hyphens, starting with a letter or digit. Writes use a complete temporary file and atomic no-replace publication; if the filesystem cannot publish it, Team reports the problem and does not replace existing files. Read-only loading and validation do not seed. To customize a saved profile, edit its full <id>.json or overlay its fields inline, then use /team config validate and /team config reload.
For example, run /team profile create my-engineering --from engineer_template, then /team profile my-engineering as a separate command. The footer says Team: Engineer until you change name to My Engineering in <Pi agent directory>/team-mode-profiles/my-engineering.json. In that same file, try setting roles.validator.workScope to Verify the personal My Engineering profile. Run /team config validate and /team config reload to apply the edit and see Team: My Engineering. Team restores this selection after /reload or resume using the latest profile file. Creating it again with the same ID leaves the edited file untouched.
User settings live in <Pi agent directory>/team-mode.json; trusted project overrides live in .pi/team-mode.json. To add a profile, define a new ID under profiles with a name and roles containing an enabled lead. To add a role, define a new ID under that profile’s roles with name and workScope. Use /team profile <id> to switch or set defaultProfile to use it at startup; see the custom profile example. Example override for built-in roles:
{
"schemaVersion": 1,
"concurrency": 5,
"profiles": {
"engineer": {
"roles": {
"coder": { "modelPool": [{ "model": "provider/model-id", "thinkingLevel": "high" }, "provider/alternate-id"], "access": null },
"scout": { "access": { "tools": ["read", "grep", "find", "ls"] } }
}
}
}
}
concurrency is an integer from 1 to 20 and defaults to 5. It's a ceiling on simultaneous worker jobs per Team session, not a target: Lead dispatches only useful work, and the scheduler starts only ready jobs. Existing explicit settings still apply, with trusted project values taking precedence over user values. The separate limit of 16 tasks per dispatch is unchanged; the concurrency ceiling applies across dispatches. Stock subagents and model providers may allow fewer workers to run at once. Jobs marked as writers still run one at a time in the shared workspace.
Every built-in pool in Engineer, Research, and Audit is empty. A blank Lead pool leaves Pi’s current model and thinking level alone, including when switching from a profile that set them. Blank worker pools inherit live foreground thinking at worker start, even for queued dependents; the live foreground model is the default. The first entry in a nonempty configured pool is the default: Lead applies it on activation, profile switch or config reload, and workers use it instead of inheriting. An unavailable configured Lead model warns and leaves the current model and level unchanged. /team off restores the pre-Team model and thinking level without changing Pi defaults.
Each entry is a model string or an object with model and optional thinkingLevel. Both accept exact provider/model-id values or aliases from aliases. Use off, minimal, low, medium, high, xhigh, or max; Pi clamps to model capabilities. An entry without a level keeps the normal Pi/backend behavior. An explicit or inherited level is forwarded through compatible RPC v2, or applied directly with the SDK if the RPC peer cannot be trusted to honor it. SDK continuations also apply the current requested level before prompting.
Trusted project settings replace user pool arrays; an explicit [] restores foreground inheritance. For workers, a task’s explicit model wins over the pending /team model selection, which wins over the configured default or foreground fallback. Task overrides must be in the pool or match the inherited default; non-default choices need a reason unless selected by /team model. Selection uses the matched entry’s thinking level. Learned alternatives and usage live in <Pi agent directory>/team-mode-models.json; a command does not rewrite config or make learned alternatives permanent defaults. The live foreground fallback is not stored as a pool member. Removing the package leaves personal profiles, settings and model history intact.
access: null adds no routine role checks. An optional access.tools list selects SDK worker tools; this is not OS isolation. Peer references are profile metadata in this release; workers report to Lead and do not have a separate team-chat feature. The built-in scheduler serializes jobs marked as writers in the shared workspace; worker worktree orchestration and durable job reattachment are not yet implemented.
Optional worker skill index