Install
Install with PiG
pig install npm:pi-team-modeInstall with Pi
pi install npm:pi-team-modePackages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.
Pi manifest JSON
The pi field of package.json.
{
"extensions": [
"./dist/extension.js"
]
}README
Written by the package's publisher, shown as published in version 0.1.9 (README.md). PiG does not review it.
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.8 adds the SDK-only Team Agents tree and session-scoped Backend and Concurrency controls. 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, effective concurrency, 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.
Open /team → Backend to see the effective preference and its source. Auto (the default) prefers ready, compatible pi-subagents for eligible jobs, otherwise uses the built-in Pi SDK. SDK routes all new Team worker launches to the SDK. Jobs waiting in Team's scheduler use the preference when they start; workers already starting, running, or queued by stock keep their route. The picker does not dispatch, cancel, or retry workers, and it leaves the stock extension, its Agents widget, and non-Team jobs alone.
Use config clears the session override and records that choice, so an older override on the same branch does not come back. The picker and Status show the effective preference and its source. The latest choice on the active branch survives profile changes, Team on/off, /team config reload, Pi /reload, and resume of the same session. /tree restores the choice at the selected point; a new session, including a fork or clone, uses current config. The picker writes only Pi session metadata, not global or project settings, and no jobs are replayed. Before Pi saves a conversation, or with --no-session, choices are held in memory. For a lasting default, set top-level "backend": "auto" or "backend": "sdk" in personal or trusted project team-mode.json and run /team config reload when idle. Precedence is session override > trusted project value > personal value > built-in Auto.
On the stock route (@tintinweb/pi-subagents 0.26.3 tested), 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 a stock 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. /team doctor reports the preference and compatible RPC readiness, not exact definition resolution. Fallback to SDK happens only before an RPC spawn attempt; a rejection, timeout or mismatched type is not retried on SDK. 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.
The separate ● Team Agents tree above the editor shows only jobs routed to the SDK. A magenta heading tops aligned rows with a status indicator, a bold padded role badge, the exact confirmed model (pending during startup, not started if it settles before start), and a task preview. The status column is one cell wide: a spinner for running jobs, a green ✓ for successful jobs, and a distinct glyph for other states. Labels such as failed, cancelled, and queued follow the task preview when there’s room. Tasks still waiting for a backend are shown only in Status.
The Braille spinner indicates an in-progress job, not model thinking. When there’s room, a child line shows thinking… only during an observed thinking stream, responding… during a text stream, or a tool action such as running command… during execution. It shows working… when Pi reports no specific activity. The line never displays streamed content, tool arguments, or tool results. It clears when the job settles or is cancelled; a cancelled job keeps its slot and says stopping until it unwinds. One visual-only timer redraws while SDK jobs are running; it does not poll workers or run inference. The tree keeps up to five recent outcomes, fits a bounded viewport, and clears on reset, profile change, config reload, disable, or runtime replacement. Status remains the combined view.
Worker follow-ups
Lead dispatches fresh by default. If the follow-up needs context a short brief can’t carry, Lead sets resume to the completed same-role task ID. For example, to have Coder use the investigation from trace-startup to diagnose a retry failure, Lead dispatches a new check-retry Coder task with resume: "trace-startup". Lead decides when to request it; Team Mode checks compatibility, routes the job, and handles fallback.
A retained SDK session can be reused in Auto or SDK with the same role, exact model, and tool list. The SDK keeps up to six sessions in memory and evicts the earliest-retained one on overflow, regardless of dispatch order. Reuse consumes the old resume reference. If check-retry completes and retains the session, use check-retry, not trace-startup, for the next continuation. Tasks and retained sessions do not survive /reload or reopening Pi.
If the prior task is still known but its SDK session is evicted, otherwise unavailable, or incompatible, or the prior task ran on stock RPC, the follow-up starts fresh with a compact Earlier result summary instead of transcript history. Status and team_results do not label the continuation outcome. Keeping history for a follow-up does not guarantee token savings.
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 Agents, 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
/teamopens the Team Mode menu: Switch profile, Create profile from template, Turn Team Mode off/on, Status, Configure role model, Concurrency, Backend, and Help. Navigate with ↑/↓ and Enter; Esc closes the current picker./team profileopens the profile-ID picker directly./team helplists all commands./team profile <id>switches directly and turns Team Mode on./team profile statusonly 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.- Concurrency or
/team concurrency 10sets a session ceiling override; enterdefaultin the picker or run/team concurrency defaultto use config. /team config edit [project],/team config validate,/team config reload.- Configure role model or
/team modelopens 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. Built-in defaults and new copies ask Lead to own recovery and replanning, without changing existing saved scopes or explicit overrides.
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,
"backend": "auto",
"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. Precedence is session override > trusted project value > personal value > built-in 5. Like Backend, the choice is saved in Pi session metadata on the active branch. It survives profile changes, Team on/off, /team config reload, Pi /reload, and resume or switching back to that session. /tree restores the choice at the selected point; new sessions, including forks and clones, use current config. default records an explicit clear so an older override on the branch doesn't return. Before Pi saves a conversation, or with --no-session, choices are held in memory. No global or project settings are written, and no jobs are replayed.
Raising the ceiling immediately schedules ready jobs; lowering it never cancels or evicts active jobs. See the effective value and source in Status and the Concurrency picker. 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
- Edit the saved profile JSON at
$PI_CODING_AGENT_DIR/team-mode-profiles/<id>.json(default:~/.pi/agent/team-mode-profiles/<id>.json). Add"skills": ["team-demo-summary"]underroles.scout, keeping the other fields. To create a copy first, use/team profile create scout-skills-demo --from engineer_template. An existing demo profile does not need to be recreated or edited if it already has the list. - Run
/team config validate, then/team config reloadwith no active workers, then/team profile scout-skills-demo(or use the ID you edited)./team config editeditsteam-mode.json, not the saved profile file. To use an inline override instead, put the field underprofiles.<id>.roles.scoutinteam-mode.json.
Entries must be distinct, exact, case-sensitive Pi skill names, not paths or globs. Overrides replace the list as a whole; [] clears it. The effective role with an omitted or empty list gets no prompt changes. Lead is unaffected.
When a worker starts, Team checks Pi’s local settings catalog, including enabled skills from already-installed packages. It honors Pi’s resource filters and excludes untrusted project resources. It does not install packages, import extensions for discovery, or use temporary CLI/extension-supplied skill paths for this index. Missing, disabled, ambiguous, or disable-model-invocation: true names fail the task before starting a worker, with the role and name in the error. /team config validate checks the list’s shape, not name availability.
In list order, the worker gets only the name, description, and absolute SKILL.md path (or the standalone Markdown path Pi recognizes). The stock worker gets the index in its role definition; the SDK worker, including Cursor, gets it in the task prompt. No full skill bodies are injected, and the worker chooses whether a file is useful. This is not a file-access allowlist: unlisted files can still be read if existing tools and permissions allow it. The tools, isolation, and stock Agents row stay as they were. Changing the stock role’s index creates a new definition identity without rewriting the old one.
Try the existing Scout demo
If your Pi home already has team-mode-profiles/scout-skills-demo.json and the enabled team-demo-summary skill (normally skills/team-demo-summary/SKILL.md), don’t edit either file:
- Start the Pi TUI with this checkout as its Team Mode source, or use
/reloadif it is already registered. Run/team profile scout-skills-demoand check forTeam: Scout Skills Demo. - Ask Lead: “Dispatch Scout only. Ask Scout for the demo summary, using its optional formatting recipe if relevant. Do not give Scout a skill path or the expected marker. Report Scout’s result verbatim.”
- With compatible stock subagents and a non-Cursor Scout model, look for the ordinary Scout badge and task brief in Agents. Check Scout’s result for
TEAM_DEMO_SUMMARY_APRICOT. If you can inspect the worker transcript, check for the separatereadofSKILL.md; the row alone proves neither delivery nor a read. An SDK worker has no native Agents row. If the result lacks the marker, inspect whether the worker opted to read or whether its tools could access the file.
The live demo uses your selected model. For offline testing from the repository root, run PI_TEAM_TEST_SUBAGENTS=/absolute/path/to/stock/pi-subagents python3 pi-team-mode/test/role-skills-pilot.py . pi-team-mode after building the nested package. It checks both entry points with stock 0.26.3 and SDK fallback, using a fake loopback model and disposable settings. From pi-team-mode after building, the optional Cursor check is PI_TEAM_TEST_CURSOR=/absolute/path/to/pi-cursor-sdk-0.5.32 node --test test/cursor-role-skills.test.mjs. It verifies index delivery to a stub transport, not live Cursor auth or file access.
Serious actions
The Lead can request one approval covering a GitHub push, opening a PR, and requesting review. It operates on a committed revision, verifies the remote and revision, never force-pushes, and does not automatically retry a partial publication. git and (for PRs/review) gh are needed. Local edits and checks do not ask for approval. Checkpoints cover Team Mode's brokered operations only: normal shell tools are not a sandbox and ambient account credentials can bypass a broker. Advanced isolation and custom checkpoint handlers are not part of this release.
Test without model credits
npm ci # from this nested directory
npm test # fake workers, mocked remote actions, loopback-only fake model
npm run test:pi # real Pi worker and package lifecycle, using the nested build
npm pack --dry-run # preview release contents; does not publish
Pack releases from this nested directory with npm pack (without --ignore-scripts). The prepack hook builds the extension and copies the repository-root LICENSE verbatim into the npm package; the root file is the source of truth.
Before publication, run python3 test/npm-tarball-smoke.py /path/to/pi-team-mode-0.1.8.tgz to serve the exact MIT tarball from a loopback npm registry. After publication, run python3 test/pi-smoke.py npm:pi-team-mode <version> to check the actual npm install and version in a disposable Pi home. The package install uses the npm registry, but the TUI and worker use only the loopback fake model.
To exercise the native Agents rows, set PI_TEAM_TEST_SUBAGENTS to the absolute path of an unmodified local @tintinweb/pi-subagents 0.26.3 package before running npm run test:pi. The PTY uses fake loopback models and checks both Status entry points, no extra inference, live model and settled summary updates, profile seeding, the /team menu (template copy and switch, role-model picker, toggle, concurrency, and Backend override/reset), CLI help and input errors, the my-engineering CLI create, edit, reload and no-clobber workflow, first-dispatch definition creation, reuse after /reload, Engineer, Research and My Engineering Validator rows (red, no suffix, plain brief), exact profile prompt/model/thinking/tools, and an ordinary Agent (twin) launched with the stock Agent tool. From the repository root, run python3 pi-team-mode/test/pi-smoke.py --git-mirror . to test the committed main via a private temporary Git mirror and a mocked GitHub response. Local-source smoke runs check that the Research worker uses an extension-only loopback provider without reloading the provider extension. Local and npm smoke runs (npm 0.1.8 and later) also check that Concurrency survives /reload and reopening, /new starts at 5, /resume restores each of two saved sessions' own ceiling, and default survives reload and reopening without replaying work. These checks run with or without stock subagents. All smoke paths use a disposable Pi config and fake credentials. Run the stock smoke again with PI_TEAM_TEST_BACKEND=sdk to select SDK through the picker, dispatch through the SDK after /reload with stock installed, and check the picker, Status and Doctor on resume. That run also checks /new isolation, switching back with /resume, and Use config surviving reload and a subsequent reopen without replaying work. The same stock and forced-SDK flags work with the loopback tarball smoke.
To check Cursor ownership offline with Node 24, build and run PI_TEAM_TEST_CURSOR=/absolute/path/to/installed/pi-cursor-sdk node --test test/cursor-worker.test.mjs. The fixture expects 0.5.32, uses a disposable Pi home and fake credential, and stubs the Cursor SDK and network transport. It leaves the real Cursor extension registration, ownership guard, and session hooks in place.
To check discovery itself, run python3 test/stock-agent-probe.py "$PI_TEAM_TEST_SUBAGENTS" and repeat with --strict-fallback. Stock discovers a late flat file and an explicitly manifest-declared nested file, but does not discover nested files just because their parent’s parent was scanned.