Skip to content

Multi-Agent Support

Navi tracks multiple AI agents running in the same tmux session — Claude Code, OpenCode, and others — displaying each agent’s status and making the main session icon reflect the highest-priority status across all agents. External agents are first-class citizens in the display.

  1. Run ./install.sh to deploy the OpenCode plugin alongside Claude Code hooks
  2. Launch Claude Code and OpenCode in the same tmux session
  3. Each session row shows per-agent indicators: [OC ●] for OpenCode working
  4. The main session icon reflects whichever agent needs the most attention

When a session has multiple agents, compact indicators appear inline:

⚙️ api [OC ●] main ✓ 2m ago
✅ frontend [OC ○] feat/nav ~ 5m ago
❓ backend main ✓ 1m ago
  • [OC ●] — OpenCode working (filled circle, cyan)
  • [OC ○] — OpenCode idle (hollow circle, gray)
  • No indicator for single-agent sessions (zero overhead)
StatusIconColor
workingCyan
permissionMagenta
waitingYellow
errorRed
doneGreen
idle / stoppedGray
Agent TypeLabel
opencodeOC
OtherFirst 2 characters (uppercased)

The main session icon reflects the highest-priority status across all agents:

Priority (highest to lowest):
permission > waiting > working > error > idle > stopped > done

If Claude Code is idle but OpenCode is working, the session shows ⚙️ (working) — not ⏸ (idle). When the composite status differs from Claude Code’s own status, a [CC ⏸] indicator appears alongside the agent indicators.

Claude CodeOpenCodeMain IconIndicators
workingidle⚙️[OC ○]
idleworking⚙️[CC ⏸] [OC ●]
idlepermission[CC ⏸] [OC ●]
donedone[OC ○]

When an external agent drives the composite status, the session message includes the source: "Running inference (opencode)".

When a multi-agent session is selected, the detail area shows a per-agent breakdown:

Agents
Composite working (opencode) ⚙️
CC idle ⏸ — "Awaiting user input"
OC working ⚙️ 3m ago

All agents write to the same session status file at ~/.claude-sessions/<session>.json:

{
"tmux_session": "api",
"status": "working",
"message": "Implementing feature X",
"cwd": "/home/user/api",
"timestamp": 1707506400,
"agents": {
"opencode": {
"status": "idle",
"timestamp": 1707506380
}
}
}
  • Root-level fields (status, message, cwd, timestamp) are Claude Code’s domain
  • The agents map holds external agent statuses, keyed by agent type
  • Each agent does read-modify-write, preserving others’ fields

The navi plugin for OpenCode lives at ~/.config/opencode/plugins/navi.js. It maps OpenCode lifecycle events to navi status strings:

OpenCode EventNavi Status
session.createdworking
tool.execute.afterworking
chat.messageworking
session.idleidle
session.errorerror
permission.updatedpermission
permission.repliedworking

The plugin resolves the tmux session name via tmux display-message, caches it for 30 seconds, and writes status atomically using temp-file-then-rename.

Claude Code’s notify.sh hook preserves the agents field during its read-modify-write cycle, ensuring external agent status is never overwritten.

Sessions with any agent (Claude Code team agents or external agents) in waiting or permission status sort to the top of the priority list, ensuring blocked agents are always visible.

The OpenCode plugin is deployed automatically by ./install.sh:

Terminal window
# Deploys to ~/.config/opencode/plugins/navi.js
./install.sh

No manual configuration is needed. OpenCode automatically loads all plugins in its plugins directory.

The multi-agent system supports any number of agent types. To add a new agent:

  1. Create a plugin/hook that writes to ~/.claude-sessions/<session>.json
  2. Use read-modify-write to update the agents.<type> entry
  3. Set status and timestamp fields
  4. Navi auto-detects and displays the new agent type