tmux Integration
tmux is the transport layer for all Genie agents. Every spawned agent runs in a tmux pane, receives messages viasend-keys injection, and is monitored through pane content capture. Understanding the tmux structure helps with debugging and manual intervention.
Session Architecture
Naming Conventions
Agent Lifecycle in tmux
Spawn
Whengenie spawn engineer runs:
- Find or create the tmux session (based on team or default)
- Create a new window named after the agent role
- Launch Claude Code in the window’s pane with the appropriate arguments
- Register the agent in the agent registry with the pane ID
Message Delivery
Messages are injected into panes usingtmux send-keys:
State Detection
The orchestrator captures pane content to determine agent state:Kill and Suspend
suspended in the registry. Their session ID is preserved for potential resume.
Session Management
Current Session
Genie detects the current tmux session through a fallback chain:- Inside tmux (
$TMUXset) — usedisplay-messagefor authoritative session name - Outside tmux —
list-sessions, prefer session matching a hint (team name)
Auto-Create
Whensession.autoCreate is true (default), Genie automatically creates the tmux session if it doesn’t exist. This means genie spawn works even if tmux has no sessions.
Team Sessions
Each team gets its own tmux session (or window group). The session name is derived from the sanitized team name:Keyboard Shortcuts
Install shortcuts withgenie setup --shortcuts or genie shortcuts install.
tmux Shortcuts
Shell Aliases
Mosaic Layout
For teams with multiple agents, Genie supports a mosaic layout that tiles all agent panes in a single view:mosaic-layout.ts and applied via tmux select-layout.
Configuration
tmux-related settings in~/.genie/config.json:
Troubleshooting
Agent Not Receiving Messages
- Check if the pane is alive:
tmux list-panes -t genie -a - Check agent state:
genie ls— should showidle - Check mailbox for pending messages: look at
.genie/mailbox/<agent>.json
Session Not Found
Pane Content Not Captured
Ifgenie read or state detection fails, check:
terminal.readLinesis sufficient (increase if prompts are far from bottom)- The pane ID in the agent registry matches an actual tmux pane
- tmux server hasn’t been restarted since agents were spawned