Skip to main content

Terminal-first orchestration for parallel AI coding agents

Project description

Shoal banner

Shoal robo-fish mascot

v0.29.0 Python 3.12+ License: MIT

FastAPI SQLite WAL tmux Fish Shell FastMCP 3.0 Pydantic v2 Ruff

Tests: 1325 passing Coverage: 82% mypy strict pre-commit enabled

Supervise a fleet of coding agents with visible state, recoverable handoffs, and human authority over every judgment call.

Agent status indicators


TL;DR

You're an engineer running AI coding agents — Claude, Codex, Pi, Gemini, OpenCode. You want them working in parallel without stomping on each other's files. You need to know when they're thinking, when they're waiting for approval, and when they've errored out. And when you step away, you need state that survives the interruption.

Shoal is the control plane for parallel coding agents. Not another agent. Not a better model. The layer above the agent interface and runtime where supervision, state, topology, handoffs, and control live. You declare sessions, Shoal gives each one a git worktree, runtime-backed session state, and a shared pool of MCP servers. One command to start. One dashboard to monitor. One CLI to control them all. Secure worker runtimes can sit underneath that layer; Shoal orchestrates them, but sandboxing and runtime security stay with the runtime.


See It in Action

Shoal terminal workflow demo


What You Get

Parallel agent loops let you run multiple coding agents simultaneously. Each agent gets its own isolated session runtime and context — no shared terminal state, no file conflicts.

Worktree isolation gives every session a dedicated git worktree. Agents work on separate branches in separate directories. Your main branch stays clean.

MCP server pool provides shared infrastructure for MCP servers via Unix socket proxying. Each agent connection spawns a fresh MCP process — no duplicate listener overhead.

Real-time status detection watches runtime output and reports each agent's state: Thinking, Waiting, Error, or Idle. Shoal now separates runtime transport from status parsing, so provider-backed session metadata and tool-specific detection rules can evolve independently.

Lifecycle hooks emit events (session_created, session_killed, status_changed) to async Python callbacks and fish shell events. Wire up notifications, logging, or custom automation without touching core code.

Agent observability records every status transition in SQLite with timestamps and optional pane snapshots. shoal history shows a color-coded timeline; capture_pane reads live terminal output via MCP.

Session graph tracks fork relationships (parent_id), tags, and template provenance. shoal ls --tree displays the fork hierarchy; shoal ls --tag filters by label.

Session templates define window layouts, pane splits, and tool configs in TOML. Templates support inheritance (extends) and composition (mixins) to eliminate duplication across workflows. Project-local templates in .shoal/templates/ shadow global ones.

Session journals provide append-only markdown logs per session with Obsidian-compatible YAML frontmatter. Search across all journals with shoal journal --search. Journals are archived automatically when sessions are killed.

Incident supervision turns a structured alert into a first-class operator workflow. shoal incident ingest records the alert, can auto-spawn a supervisor lane, and tracks worker lanes plus Claude hook events in the same incident timeline. claude, omp, and opencode all participate through the same incident surface.

Remote sessions let you monitor and control agents on remote machines via SSH tunnel. shoal remote connect opens a tunnel; shoal remote ls and shoal remote send work through it.

Shoal MCP server exposes orchestration tools (list, create, kill, send keys, capture pane, read history) via FastMCP so agents can call Shoal natively — enabling robo supervisor workflows where agents manage other agents.

Robo supervisor runs an autonomous supervision loop that polls agent status, auto-approves known-safe prompts, and escalates ambiguous cases to an LLM agent session. Run it as a foreground process or a background daemon.

Diagnostics built in — shoal diag checks DB connectivity, watcher PID, tmux reachability, and MCP sockets. shoal mcp doctor runs protocol-level health checks on pooled servers.


How It Works

Shoal architecture diagram

  1. You run shoal new — Shoal creates a provider-backed session runtime, optionally provisions a git worktree and branch, and launches your chosen AI tool inside it.

  2. Each agent gets isolation — Separate worktree, separate branch, separate runtime context. Agents cannot interfere with each other's files.

  3. MCP servers are pooled — Instead of each agent spawning its own MCP servers, Shoal runs a shared pool. Agents connect through shoal-mcp-proxy for shared infrastructure (each connection spawns a fresh MCP process).

  4. Status is tracked continuously — A background monitor asks the active runtime provider for liveness and output, then applies the configured status provider rules and writes state to a SQLite WAL database. Every transition is recorded with timestamps. The FastAPI server exposes this via a local API.

  5. You control everything from one CLIshoal status shows all agents. shoal popup opens a TUI dashboard. shoal attach jumps into any session. shoal robo watch launches a supervisor to automate the whole fleet.


Quick Start

Prerequisites

Shoal requires these tools on your system:

Tool Install Why
uv curl -LsSf https://astral.sh/uv/install.sh | sh Python package manager — installs Shoal and its dependencies
fish sudo apt install fish / brew install fish Recommended for the reference shell experience — completions, key bindings, abbreviations
tmux sudo apt install tmux / brew install tmux Session multiplexer — each agent runs in its own tmux pane
git sudo apt install git / brew install git Worktree isolation and branch management
fzf sudo apt install fzf / brew install fzf Interactive session picker for shoal attach

Optional:

Tool Install Why
gh sudo apt install gh / brew install gh GitHub CLI — used by shoal wt finish --pr
nvr pip install neovim-remote Neovim remote control integration

Reference stack: Python 3.12+, tmux 3.3+, fish 3.6+. Core Shoal workflows work without fish, but the intended shell UX is fish-first.

shoal init checks for tmux, git, fzf, gh, and nvr and reports what's missing.

Install

Via Homebrew (macOS)

brew install TheShoal/tap/shoal-cli

From PyPI

pipx install shoal-cli

# or with uv
uv tool install shoal-cli

# With MCP support (enables shoal-orchestrator MCP server)
uv tool install "shoal-cli[mcp]"

Direct binary download

Download a self-contained binary from the latest release:

# macOS Apple Silicon
curl -Lo shoal https://github.com/TheShoal/shoal-cli/releases/latest/download/shoal-darwin-arm64
chmod +x shoal && sudo mv shoal /usr/local/bin/

See getting-started for all platform options.

From source

git clone https://github.com/TheShoal/shoal-cli.git
cd shoal-cli
uv tool install -e ".[dev,mcp]"
uv tool install pre-commit
just setup                   # install pre-commit + commit-msg hooks

Setup

shoal init          # create DB, scaffold configs, check dependencies
shoal setup fish    # install fish completions, keybindings, abbreviations

shoal init creates ~/.config/shoal/ (config, tool profiles, templates), ~/.local/share/shoal/ (database, journals, robo data, MCP pool state), and ~/.local/state/shoal/ (runtime logs and PID files). It also checks that required tools are installed and reports anything missing.

Try the Demo

shoal demo tutorial   # interactive hands-on walkthrough
shoal demo start      # guided demo environment
shoal demo stop       # tear down when done

60-Second Workflow

# Create 3 parallel agents, each in its own worktree
shoal new -t claude -w auth -b
shoal new -t codex -w api-refactor -b
shoal new -t gemini -w docs -b

# Check on everyone
shoal status

# Open the dashboard
shoal popup

# Attach to a session
shoal attach auth

# When done, merge and clean up
shoal wt finish auth --pr

shoal new defaults to your configured default_tool. Pass -t/--tool to override.

Incident Workflow

Turn a P1-style alert into a supervisor lane plus focused worker lanes.

# Ingest a structured alert and auto-spawn a supervisor lane
shoal incident ingest alert.json --path . --tool claude

# Add a focused investigator lane using omp or opencode
shoal incident spawn incident-abcd1234 --role incident-investigator --tool omp
shoal incident spawn incident-abcd1234 --role incident-comms --tool opencode

# Review the incident timeline, lanes, and hook-driven updates
shoal incident show incident-abcd1234

# Generate optional Claude hook files (manual opt-in)
shoal incident hook-scaffold

Use Cases

Parallel Feature Development

Work on frontend, backend, and docs simultaneously:

shoal new -t claude -w feature-ui -b
shoal new -t codex -w feature-api -b --template codex-dev
shoal new -t gemini -w feature-docs -b

Each agent works in its own worktree with pooled MCP server infrastructure.

Code Review Automation

Have one agent write code, another review it:

shoal new -t claude -w implement-auth -b
shoal new -t codex -w review-auth -b
# Reviewer accesses implementer's worktree via shared filesystem MCP
Autonomous Supervision

Run a robo supervisor that auto-approves safe prompts and escalates ambiguous cases:

shoal robo watch default              # foreground supervision loop
shoal robo watch default --daemon     # background daemon mode
shoal robo watch-status default       # check daemon health

The supervisor polls agent status, pattern-matches pane content against safe-to-approve rules, and escalates anything ambiguous to a configured LLM agent session.

See docs/ROBO_GUIDE.md for detailed patterns.


Commands

Session Management

Command Alias Description
shoal new add Create a new session (optionally with a worktree)
shoal ls List sessions (--tag, --tree supported)
shoal attach a Attach to a session (fzf picker if no name)
shoal kill rm Stop a session and clean up worktrees
shoal fork Fork a session (tracked parent/child graph)
shoal rename Rename a session
shoal info Detailed session summary with tags and lineage
shoal popup pop Open the interactive TUI dashboard
shoal history Status transition timeline with durations
shoal tag Add, remove, or list session tags

Journals (shoal journal)

Command Description
<session> View a session's journal
--append <message> Append an entry to a session journal
--archived Read archived journals from killed sessions
--search <query> Search across all session journals

Worktrees (shoal wt)

Command Description
ls List managed worktrees
finish Merge, delete branch, and remove worktree
cleanup Remove orphaned worktrees

MCP Pool (shoal mcp)

Command Description
start Start a pooled MCP server
stop Stop a pooled MCP server
attach Connect a session to a pooled server
doctor Protocol-level health check on pooled servers
registry Show configured MCP server registry
logs View MCP server log files

Diagnostics & Config

Command Description
shoal diag Check DB, watcher, tmux, MCP socket health
shoal config show Display resolved configuration
shoal status Aggregate status counts across all agents

Templates (shoal template)

Command Description
ls List available session templates
show <name> Display a template's resolved config
show --raw Display unresolved template (pre-merge)
validate <name> Validate a template against the schema
mixins List available template mixins

Extensions (shoal fin)

Command Description
inspect <path> Show fin manifest metadata and resolved entrypoints
install <path> Execute fin install lifecycle entrypoint
configure <path> Execute fin configure lifecycle entrypoint
validate <path> Validate manifest and run fin validate entrypoint
run <path> Execute fin run with args passthrough after --
ls [--path <dir>] List local path-based fin candidates and validity

Demo (shoal demo)

Command Description
start Spin up a full demo environment with example sessions
stop Tear down the demo environment
tour Guided 7-step feature walkthrough
tutorial Interactive hands-on tutorial with real sessions

Robo Supervisor (shoal robo)

Command Description
start Launch the supervisor agent session
watch Start the autonomous supervision loop
watch --daemon Run supervision as a background daemon
watch-stop Stop a running daemon
watch-status Check daemon health
approve Send "Enter" to a waiting agent
send Send arbitrary keys to a child session

Remote Sessions (shoal remote)

Command Description
ls List configured remote hosts
connect Open SSH tunnel to remote API
disconnect Close SSH tunnel
status Show remote session status summary
sessions List sessions on remote host
send Send keystrokes to remote session
attach Attach to remote tmux session via SSH

Fish Shell Integration

shoal setup fish

Installs tab completions, key bindings (Ctrl+S popup, Alt+A attach), abbreviations (sa, sl, ss, sp), and helper functions. Fish event hooks (__shoal_on_waiting, __shoal_on_error) let you wire up notifications without writing Python. See Fish Integration Guide for details.

For completions only:

shoal --install-completion fish

Supported Tools

Tool Command Status
Pi pi Primary
Claude Code claude Supported
Codex codex Compatible
OpenCode opencode Compatible
Gemini gemini Supported

Tool configs live in ~/.config/shoal/tools/<name>.toml with per-tool detection patterns and status_provider adapters.

Shoal currently ships one runtime provider (tmux) and multiple status providers (regex, pi, opencode_compat). OpenCode runs in compatibility mode for status detection; Pi remains the reference backend for status fidelity.


Status

Milestone Focus Status
v0.29.0 MCP robo tools, PyApp binary, omp default, deferred imports, config split Current
v0.28.0 Fleet demo, shoal-native skills, project config, pane targeting fix Complete
v0.27.0 Workspace routing, structured handoff packets, operating modes, template tags Complete
v0.26.0 Incident supervision, lifecycle hooks, Claude hook integration Complete
v0.25.0 Runtime-provider architecture, nested session runtime model Complete
v0.24.0 Worker completion signals, git MCP tools, remote fin install Complete
v0.23.0 Urgency-based operator board, popup triage, handoff packets Complete

See ROADMAP.md for the full plan.


Development

just ci          # all CI checks (lint, typecheck, test, fish-check, security)
just lint        # lint with ruff
just fmt         # auto-format with ruff
just test        # tests (exclude integration)
just typecheck   # mypy --strict
just cov         # tests with coverage report
just setup       # install pre-commit hooks

1227 tests | 82% coverage | mypy --strict | pre-commit enforced | conventional commits

See CONTRIBUTING.md for full setup instructions.


Documentation

just docs-serve   # serve the docs site locally
just docs-build   # build the docs site with strict validation

Core docs entry points:

Guides and supporting material:


License

MIT License. See LICENSE for details.

footer

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shoal_cli-0.29.0.tar.gz (4.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shoal_cli-0.29.0-py3-none-any.whl (222.6 kB view details)

Uploaded Python 3

File details

Details for the file shoal_cli-0.29.0.tar.gz.

File metadata

  • Download URL: shoal_cli-0.29.0.tar.gz
  • Upload date:
  • Size: 4.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for shoal_cli-0.29.0.tar.gz
Algorithm Hash digest
SHA256 3c172e4c8bbe5a02a62b8250023047689062741282ef5183cb1e21290e165358
MD5 4ea48940157d61d58eef70e649bb063b
BLAKE2b-256 cbdd142b1af50352d8fd24c28a5b9ea1fc28bdacd869bdd38a3e64d3d48d44b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for shoal_cli-0.29.0.tar.gz:

Publisher: release.yml on TheShoal/shoal-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shoal_cli-0.29.0-py3-none-any.whl.

File metadata

  • Download URL: shoal_cli-0.29.0-py3-none-any.whl
  • Upload date:
  • Size: 222.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for shoal_cli-0.29.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3390103f95a72d47d51252076bd093e1d5f1616fe011f8d63a1117b61deebc7
MD5 961f7be8a465eea52fc7171be7a37a15
BLAKE2b-256 9d8e39cd712c8deee7dcdea697edc817296bc1ee7be43e9d62b69722dff331ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for shoal_cli-0.29.0-py3-none-any.whl:

Publisher: release.yml on TheShoal/shoal-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page