Sessions
Overview
Sessions are managed through the Flaio terminal UI. Each session runs an AI agent (Claude Code or Gemini CLI) in its own tab with a full PTY terminal.
Creating a Session
Press Ctrl+T inside the Flaio TUI to create a new session:
- Select an agent driver — Claude Code or Gemini CLI.
- Choose a model (e.g., Claude Sonnet 4.6, Claude Opus 4.6, Gemini 2.5 Pro).
- Enter a working directory (tab completion supported).
The agent spawns in the selected directory and is ready for interaction.
Supported Agents
| Agent | Models |
|---|---|
| Claude Code | Claude Sonnet 4.6, Claude Opus 4.6, Claude Haiku 4.5 |
| Gemini CLI | Gemini 2.5 Pro, Gemini 2.5 Flash |
Session Lifecycle
Sessions go through the following states:
| State | Description |
|---|---|
idle | Just started |
running | Agent is processing |
waiting_input | Waiting for your prompt |
waiting_permission | Awaiting tool permission approval |
exited | Process terminated |
Session Metadata
Each session tracks:
- Model — the active model name
- Cost — cumulative cost in USD (toggle display with
ui.showCostsetting) - Context — context window usage percentage
- Lines changed — total lines added and removed
- Exit code — 0 for clean exit, non-zero for errors
Closing Sessions
Press Ctrl+W to close the active session tab. Press Ctrl+Q to quit the app (closes all sessions).
Adopting Standalone Agents
If you have a Claude Code or Gemini CLI process running outside of Flaio, you can adopt it:
- Press
Alt+A(oråon macOS) to open the adoption dialog. - Select the detected agent from the list.
- The external process is terminated and the session continues in a managed tab.
Flaio scans for standalone agents every 5 seconds (configurable via agents.detectorInterval).
Scrolling
- Mouse wheel — scroll up and down
- Ctrl+U — scroll up
- Ctrl+D — scroll down
- Shift+Drag — select text