@adamjen/pi-interactive-subagents
Orchestrating Subagents Asynchronously in Terminal Multiplexers
Install & Use
Copy this prompt and send it to your AI assistant (Claude / Cursor / TRAE / Codex / WorkBuddy etc.) to auto-install:
Help me install this AI Skill: @adamjen/pi-interactive-subagents. It is used for: Orchestrating Subagents Asynchronously in Terminal Multiplexers Full Skill content: https://321skill.com/skills/adamjen-pi-interactive-subagents/raw/index.md Read that page and install it.
The prompt includes a link to the full Skill content. You can also view the full content.
This Skill addresses the issue where AI developers' main workflow gets blocked when they need to run multiple background sub-tasks concurrently for complex tasks. In practical development, developers often need to perform time-consuming operations like code review, database analysis, and test runs in parallel. However, traditional serial approaches interrupt the conversational flow, leading to inefficiency.
Usage is straightforward: simply call the subagent() function in the pi terminal, passing in the subagent name, target agent, and task description. You can then start a subagent using natural language instructions, e.g., subagent({ name: "Scout: Auth", agent: "scout", task: "Analyze auth module" }). The call returns immediately, with the subagent running in an independent pane and notifying the main session asynchronously upon completion.
It is particularly well-suited for agent developers and backend engineers who require deep technical research or parallel task processing. Teams already using terminal multiplexers like cmux, tmux, or zellij to manage their development environments can seamlessly integrate it into their existing workflows, enabling concurrent multitasking without losing context.
It is recommended to ensure you are running within a supported terminal multiplexer before starting pi. Note that you may need to adjust PI_SUBAGENT_SHELL_READY_DELAY_MS (default 500ms) to accommodate slower shell startup environments. Importantly, this Skill primarily relies on the pi-mono framework and is not a standalone, general-purpose tool. Subagent windows do not steal keyboard focus, making them ideal for silent background operation.
Key Features
Unlike manually splitting panes in tmux or zellij to run commands, pi-interactive-subagents automatically manages the lifecycle, state monitoring, and result callbacks of subagents at the AI conversation level. The main agent receives completion notifications asynchronously without needing to poll, enabling truly non-blocking task orchestration.
Limitations
It depends on the pi-mono framework and specific terminal multiplexers (cmux/tmux/zellij/WezTerm). If shell startup is slow, the delay configuration must be adjusted; otherwise, subagent commands may be lost.
FAQ
How do I install this Skill?
Run `pi install git:github.com/HazAT/pi-interactive-subagents` in the pi terminal to install it.
Which terminal multiplexers are supported?
It supports cmux, tmux, zellij, and WezTerm. You can force a specific backend using the environment variable `PI_SUBAGENT_MUX`.
Installation guide for AI assistants
If your AI coding assistant (Claude Code, Cursor, TRAE etc.) can see this page, send it this message to auto-install:
Visit https://321skill.com/skills/adamjen-pi-interactive-subagents/raw/index.md to read the original Skill definition (Markdown format) for @adamjen/pi-interactive-subagents, and install it according to the instructions.
Raw Markdown URL for AI: /skills/adamjen-pi-interactive-subagents/raw/index.md