# yoanwai/agent-manager architecture

> Architecture diagram of the GitHub repository yoanwai/agent-manager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yoanwai/agent-manager
- Repository: https://github.com/yoanwai/agent-manager

## Overview

agent-manager is a terminal-based control plane for running multiple AI coding agents in persistent, private tmux sessions. The main workflow is to open the manager, launch or select an agent, monitor its status, send prompts, and review its Git changes; agents can also delegate work through MCP tools. Its README additionally describes grouped session management, managed shells, forks, and notifications. Connections reflect the README and shown source references; unsampled internals are represented only where their subsystem is documented.

Main entry points: [`main.go`](https://github.com/yoanwai/agent-manager/blob/main/main.go) (Application entry), [`internal/ui`](https://github.com/yoanwai/agent-manager/tree/main/internal/ui) (Manager interface), [`internal/sessioncmd/session.go`](https://github.com/yoanwai/agent-manager/blob/main/internal/sessioncmd/session.go) (Session commands), [`internal/launch/launch.go`](https://github.com/yoanwai/agent-manager/blob/main/internal/launch/launch.go) (Agent launch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Manager runtime"]
  node_main["Application entry<br/>[main.go]"]
  node_ui["Manager interface"]
  node_config["Configuration<br/>[config.go]"]
end

subgraph group_sessions["Session lifecycle"]
  node_sessioncmd["Session commands<br/>[session.go]"]
  node_launch["Agent launch<br/>[launch.go]"]
  node_tmux["Persistent sessions<br/>[tmux.go]"]
  node_store[("Session state<br/>[store.go]")]
  node_terminalcmd["Managed terminals<br/>[terminal.go]"]
end

subgraph group_review["Review and status"]
  node_git["Git operations<br/>[git.go]"]
  node_diff["Change review<br/>[diff.go]"]
  node_status["Agent status<br/>[status.go]"]
end

subgraph group_agenttools["Agent integrations"]
  node_hooks["Agent hooks<br/>[hooks.go]"]
  node_mcpreg["MCP registration<br/>[mcpreg.go]"]
  node_mcpserver["MCP tools<br/>[mcpserver.go]"]
  node_report["Issue reporting<br/>[report.go]"]
end

subgraph group_support["Platform services"]
  node_notify["Notifications<br/>[notify.go]"]
  node_update["Self update<br/>[update.go]"]
end

node_developer(("Developer"))
node_agentcli["Installed agent CLIs"]
node_gitservice["Git repositories"]

node_developer -->|"starts"| node_main
node_main -->|"loads"| node_config
node_main -->|"initializes"| node_tmux
node_main -->|"initializes"| node_status
node_main -->|"runs"| node_ui
node_ui -.->|"launches sessions"| node_sessioncmd
node_sessioncmd -->|"plans launch"| node_launch
node_sessioncmd -->|"creates panes"| node_tmux
node_sessioncmd -->|"records sessions"| node_store
node_sessioncmd -->|"manages worktrees"| node_git
node_launch -->|"reads settings"| node_config
node_launch -->|"configures hooks"| node_hooks
node_launch -->|"registers tools"| node_mcpreg
node_launch -->|"starts session"| node_tmux
node_tmux -->|"runs CLI"| node_agentcli
node_agentcli -->|"runs in"| node_tmux
node_ui -->|"opens shells"| node_terminalcmd
node_ui -->|"opens review"| node_diff
node_diff -->|"reads changes"| node_git
node_git -->|"queries"| node_gitservice
node_main -->|"serves MCP"| node_mcpserver
node_mcpserver -->|"dispatches tools"| node_sessioncmd
node_mcpserver -->|"uses reporter"| node_report
node_mcpreg -->|"configures hooks"| node_hooks
node_main -->|"handles helper"| node_notify
node_main -->|"sets build source"| node_update
node_ui -.->|"shows activity"| node_status
node_ui -->|"persists ordering"| node_store
node_mcpserver -->|"exposes tools"| node_agentcli

click node_main "https://github.com/yoanwai/agent-manager/blob/main/main.go"
click node_ui "https://github.com/yoanwai/agent-manager/tree/main/internal/ui"
click node_config "https://github.com/yoanwai/agent-manager/blob/main/internal/config/config.go"
click node_sessioncmd "https://github.com/yoanwai/agent-manager/blob/main/internal/sessioncmd/session.go"
click node_launch "https://github.com/yoanwai/agent-manager/blob/main/internal/launch/launch.go"
click node_tmux "https://github.com/yoanwai/agent-manager/blob/main/internal/tmux/tmux.go"
click node_store "https://github.com/yoanwai/agent-manager/blob/main/internal/store/store.go"
click node_terminalcmd "https://github.com/yoanwai/agent-manager/blob/main/internal/sessioncmd/terminal.go"
click node_git "https://github.com/yoanwai/agent-manager/blob/main/internal/git/git.go"
click node_diff "https://github.com/yoanwai/agent-manager/blob/main/internal/diff/diff.go"
click node_status "https://github.com/yoanwai/agent-manager/blob/main/internal/status/status.go"
click node_hooks "https://github.com/yoanwai/agent-manager/blob/main/internal/hooks/hooks.go"
click node_mcpreg "https://github.com/yoanwai/agent-manager/blob/main/internal/mcpreg/mcpreg.go"
click node_mcpserver "https://github.com/yoanwai/agent-manager/blob/main/internal/mcpserver/mcpserver.go"
click node_report "https://github.com/yoanwai/agent-manager/blob/main/internal/report/report.go"
click node_notify "https://github.com/yoanwai/agent-manager/blob/main/internal/notify/notify.go"
click node_update "https://github.com/yoanwai/agent-manager/blob/main/internal/update/update.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_ui,node_config toneBlue
class node_sessioncmd,node_launch,node_tmux,node_store,node_terminalcmd toneAmber
class node_git,node_diff,node_status toneMint
class node_hooks,node_mcpreg,node_mcpserver,node_report toneRose
class node_notify,node_update,node_developer,node_agentcli,node_gitservice toneIndigo
```

## Components

### Manager runtime

- [Application entry](https://github.com/yoanwai/agent-manager/blob/main/main.go): `main.go`
- [Manager interface](https://github.com/yoanwai/agent-manager/tree/main/internal/ui): `internal/ui`
- [Configuration](https://github.com/yoanwai/agent-manager/blob/main/internal/config/config.go): `internal/config/config.go`

### Session lifecycle

- [Session commands](https://github.com/yoanwai/agent-manager/blob/main/internal/sessioncmd/session.go): `internal/sessioncmd/session.go`
- [Agent launch](https://github.com/yoanwai/agent-manager/blob/main/internal/launch/launch.go): `internal/launch/launch.go`
- [Persistent sessions](https://github.com/yoanwai/agent-manager/blob/main/internal/tmux/tmux.go): `internal/tmux/tmux.go`
- [Session state](https://github.com/yoanwai/agent-manager/blob/main/internal/store/store.go): `internal/store/store.go`
- [Managed terminals](https://github.com/yoanwai/agent-manager/blob/main/internal/sessioncmd/terminal.go): `internal/sessioncmd/terminal.go`

### Review and status

- [Git operations](https://github.com/yoanwai/agent-manager/blob/main/internal/git/git.go): `internal/git/git.go`
- [Change review](https://github.com/yoanwai/agent-manager/blob/main/internal/diff/diff.go): `internal/diff/diff.go`
- [Agent status](https://github.com/yoanwai/agent-manager/blob/main/internal/status/status.go): `internal/status/status.go`

### Agent integrations

- [Agent hooks](https://github.com/yoanwai/agent-manager/blob/main/internal/hooks/hooks.go): `internal/hooks/hooks.go`
- [MCP registration](https://github.com/yoanwai/agent-manager/blob/main/internal/mcpreg/mcpreg.go): `internal/mcpreg/mcpreg.go`
- [MCP tools](https://github.com/yoanwai/agent-manager/blob/main/internal/mcpserver/mcpserver.go): `internal/mcpserver/mcpserver.go`
- [Issue reporting](https://github.com/yoanwai/agent-manager/blob/main/internal/report/report.go): `internal/report/report.go`

### Platform services

- [Notifications](https://github.com/yoanwai/agent-manager/blob/main/internal/notify/notify.go): `internal/notify/notify.go`
- [Self update](https://github.com/yoanwai/agent-manager/blob/main/internal/update/update.go): `internal/update/update.go`

### Other components

- **Developer**
- **Installed agent CLIs**
- **Git repositories**

## Connections

- Developer → Application entry: starts
- Application entry → Configuration: loads (evidence: `main.go`)
- Application entry → Persistent sessions: initializes (evidence: `main.go`)
- Application entry → Agent status: initializes (evidence: `main.go`)
- Application entry → Manager interface: runs (evidence: `main.go`)
- Manager interface → Session commands: launches sessions
- Session commands → Agent launch: plans launch (evidence: `internal/sessioncmd/session.go`)
- Session commands → Persistent sessions: creates panes (evidence: `internal/sessioncmd/session.go`)
- Session commands → Session state: records sessions (evidence: `internal/sessioncmd/session.go`)
- Session commands → Git operations: manages worktrees (evidence: `internal/sessioncmd/session.go`)
- Agent launch → Configuration: reads settings (evidence: `internal/launch/launch.go`)
- Agent launch → Agent hooks: configures hooks (evidence: `internal/launch/launch.go`)
- Agent launch → MCP registration: registers tools (evidence: `internal/launch/launch.go`)
- Agent launch → Persistent sessions: starts session (evidence: `internal/launch/launch.go`)
- Persistent sessions → Installed agent CLIs: runs CLI
- Installed agent CLIs → Persistent sessions: runs in
- Manager interface → Managed terminals: opens shells
- Manager interface → Change review: opens review
- Change review → Git operations: reads changes (evidence: `internal/diff/diff.go`)
- Git operations → Git repositories: queries (evidence: `internal/git/git.go`)
- Application entry → MCP tools: serves MCP (evidence: `main.go`)
- MCP tools → Session commands: dispatches tools (evidence: `internal/mcpserver/mcpserver.go`)
- MCP tools → Issue reporting: uses reporter (evidence: `internal/mcpserver/mcpserver.go`)
- MCP registration → Agent hooks: configures hooks (evidence: `internal/mcpreg/mcpreg.go`)
- Application entry → Notifications: handles helper (evidence: `main.go`)
- Application entry → Self update: sets build source (evidence: `main.go`)
- Manager interface → Agent status: shows activity
- Manager interface → Session state: persists ordering (evidence: `internal/ui/dragdrop.go`)
- MCP tools → Installed agent CLIs: exposes tools (evidence: `internal/mcpserver/mcpserver.go`)
