# Tab icons

> What decides each tab's icon, how to add or build your own in Settings › Icons, and how overlays badge a tab when Claude Code needs you.

Every tab in Flow wears a small card: the logo of the program running in a terminal, or the icon of the tab's kind. A session's row in the sidebar stacks one card per pane, so you can tell at a glance which session runs Claude Code, which runs Neovim and which is a plain shell. Programs can also raise an **overlay**, a badge on the card that says why a pane wants you, such as the amber `?` Claude Code raises while it asks you something. This page covers what picks an icon, how to change the catalog, and how overlays work.

## What decides a tab's icon

### Terminal tabs

A terminal tab wears the icon of the program running in it, checked every couple of seconds from the pane's foreground processes.

- **The outermost program wins.** Flow picks the outermost process that has an icon, so Claude Code running `cargo test` still wears Claude's icon.
- **Runtimes come last.** An icon for a language runtime (Node.js, Python, Bun) counts only when nothing else in the chain has one: a Python script that starts Claude is Claude, and Python alone is Python.
- **Shells fill in.** A pane with no match wears the shell's icon; an unknown process is ignored.
- **Matching** compares the command's basename, case-insensitively, with a login shell's leading `-` stripped and a version suffix ignored (`python3.12` is `python`). It looks through launchers (`env`, `npx`, `bunx`, `bun x`, `pnpm dlx`, `npm exec`, `uvx`, `uv run` and similar) and interpreters (`node …/claude`, `python -m aider`) to the real program. Icons you added are matched before the built-ins.
- **Remote panes** (a session on a remote host) wear the shell's icon: Flow cannot see the programs on the other machine.

### Other tab kinds

Files, Notes, PR review, web, New tab and Shells tabs each wear their kind's icon whatever runs in them. These are catalog entries like a program's, so you can replace them.

- **PR review tabs** show their pull request's status (the state chip's colour and glyph) once it has been fetched, as long as you have not replaced the built-in PR review icon.
- **Web tabs** show the page's favicon once it has loaded, on a background picked from the favicon's own colours. With **Colour cards from favicons** off (`appearance.tab_icon_favicon_ground`), every favicon sits on white.
- **Details tabs** always wear a plain glyph; there is no catalog entry for them.
- **Tools** in the sidebar's Tools band have icons of their own too. A CLI tool page wears the icon you pick for it in Settings › Tools (or with `flow-cli tool cli edit NAME --icon ID`), else the icon of the program its command runs, else the generic CLI tool icon. The bundled `drop` command wears drop's icon in a pane too.

### Session stacks and tile tabs

- In the sidebar, the horizontal tabs and the main pane's header, a session shows a **stack**: the front card is always the session's main pane (never simply the focused one), with up to three cards behind it for its other panes. The tooltip names the program and the pane count, for example `Claude Code · 3 panes`.
- A tab in a tile's tab strip shows the single icon of its own pane.

## Turn tab icons on or off

**Show tab icons** (Settings › Icons, `appearance.tab_icons`, on by default) draws the cards. Off, tabs go back to plain glyphs, but an overlay still shows as a badge on its own: it is a signal, not decoration.

## The icon catalog

The catalog lives in `~/.flow/icons/` (Settings › Icons › Open folder): one image per icon and a manifest, `icons.json`. The folder is global, the same for every checkout and worktree. Flow notices an edit made directly in the folder within a couple of seconds and reloads it.

```json
{
  "icons": [
    {"id": "claude", "label": "Claude Code", "match": ["claude"], "tile": "#d97757", "file": "claude.svg"},
    {"id": "aider", "label": "Aider", "match": ["aider"], "added": true,
     "built": {"ground": {"kind": "solid", "stops": ["#336699"]}, "glyph": "A", "font": null}}
  ],
  "overlays": [{"id": "question", "glyph": "?", "color": "#e3b341", "border": true, "label": "Question"}],
  "triggers": {"PermissionRequest": "question", "Stop": "clear"},
  "seeded": ["claude", "question", "trigger:Stop"]
}
```

| Field | Meaning |
|---|---|
| `id` | `[a-z0-9-]`, up to 32 characters |
| `label` | The name shown in Settings and tooltips |
| `match` | The command names that resolve to this icon |
| `tile` | `#rrggbb`: the card's colour behind an image |
| `file` | An image in the same folder: `.svg`, `.png`, `.jpg` or `.jpeg`, at most 2 MiB |
| `built` | A built icon instead of an image: a background (`ground`), a `glyph` and a `font` (or `null`) |
| `added` | `true` for an icon you added rather than a built-in |
| `seeded` | Every built-in icon, overlay and trigger Flow has ever offered |

Flow never overwrites your files. At each launch it adds only the built-ins whose id is not yet in `seeded`, so a built-in you delete stays deleted, while one that is new in a later release still arrives. A manifest that is missing or cannot be read falls back to the built-in icons (Settings › Icons says so), and an entry Flow cannot read is skipped without touching the rest.

### Built-in program icons

| Icon | Matches |
|---|---|
| Claude Code | `claude`, `claude-code` |
| Codex | `codex` |
| Gemini | `gemini`, `gemini-cli` |
| Cursor | `cursor`, `cursor-agent` |
| pi | `pi` |
| Bun | `bun`, `bunx` |
| Node.js | `node`, `nodejs`, `npm`, `npx`, `pnpm`, `yarn` |
| Python | `python`, `pip`, `uv` |
| Rust | `cargo`, `rustc`, `rustup`, `rust-analyzer` |
| Neovim | `nvim`, `neovim`, `vim`, `vi` |
| Shell | `zsh`, `bash`, `fish`, `sh`, `dash`, `ksh` |

The catalog also holds the tab kinds (Files tab, Notes tab, PR review tab, Web tab, New tab, Shells tab) and the tools (Task Manager, Schedules, Factory, Reviews, My PRs, Trash, Puddle, drop, CLI tool). Their match words are fixed.

## Manage icons in Settings › Icons

Settings › Icons lists every icon: programs first, then tools, then tab kinds. Each row shows the real card, the label, its match words (or what the tool or tab kind is), and its status: **Default**, **Replaced** or **Added**. Changes land live on open tabs; a write that fails shows a toast.

| Button | What it does |
|---|---|
| Add icon… | Asks for an image file, then a **Name**, the **Commands to match** and a **Tile colour** |
| Create icon… | Opens the icon builder for a new icon |
| Replace… | Swaps the icon's image for another file; a built-in becomes Replaced |
| Build… / Edit… | Turns the icon into a built one, or edits a built one, in the builder |
| Reset | Restores a replaced built-in |
| Remove | Deletes an icon you added |
| Open folder | Reveals `~/.flow/icons/` in Finder |

### Build an icon

The icon builder makes an icon from a background and a glyph, with no image file:

1. Click **Create icon…**, or **Build…** on an existing row.
2. Enter a **Name** and the **Commands to match** (a tool's or tab kind's commands are fixed, so the field is not shown for those).
3. Pick the glyph: **Letters** (one or two letters or digits, in a font from the font picker) or **Emoji** (one emoji, from a searchable grid). With no glyph typed, the name's initials stand in.
4. Pick the background with the ground picker, the same one as in Settings › Sidebar and the label editor.
5. Press Enter or **Create icon** (**Save icon** when editing). Esc leaves a field, then closes the form.

The builder shows a large preview and the real card at actual size on a row as you go. A new icon with no commands can still be picked for a tool in Settings › Tools.

## Icon overlays

An overlay is a small badge a program raises on its pane's icon, with an optional ring around the card. It works like the unread dot, from inside the pane, but says *why* the pane wants you. `question`, an amber `?` with a ring, is the one built-in overlay.

### Define an overlay

Overlays are data: add an entry to the `overlays` list in `~/.flow/icons/icons.json`.

```json
{ "id": "review", "glyph": "R", "color": "#58a6ff", "border": false, "label": "Review" }
```

| Field | Meaning |
|---|---|
| `id` | `[a-z0-9-]`, up to 32 characters; `clear` is reserved |
| `glyph` | Up to 3 characters of text, or an image file in the same folder (`review.svg`, `.png`, `.jpg`) |
| `color` | `#rrggbb`: the badge, and the ring if there is one |
| `border` | `true` adds a ring around the card |
| `label` | The name in Settings and tooltips, as in `Claude Code · 3 panes · review in pane 2` |

The Overlays block in Settings › Icons is read-only: each overlay's preview, its triggers and the one-line command that raises it.

### Raise an overlay from a program

Any program can raise an overlay on its own pane with an OSC 9 escape, from a script or over ssh:

```sh
printf '\033]9;flow:overlay:review\007'    # raise
printf '\033]9;flow:overlay:clear\007'     # clear
```

These never mark a tab unread, and an id Flow does not know is ignored.

### When an overlay clears

A pane holds one overlay, and the last one set wins. It clears on `flow:overlay:clear`; when you press Enter, Esc, Ctrl-C or a digit in the pane (arrow keys do not, because they move through a question's choices); when the pane's program changes or exits; and when the session closes. Overlays are never saved across restarts.

### Where an overlay shows

- **Session stacks** (sidebar rows, session tabs): an overlay in any pane of the session shows on the front card, and the tooltip names the pane.
- **Tile strip tabs**: each tab shows its own pane's overlay.
- **The Flow agent's pill** shows each agent tab's overlay on its card.
- With **Show tab icons** off the badge still shows, alone, where the stack would be.

## Overlays from Claude Code

### Triggers

The `triggers` map in `icons.json` turns Claude Code hook events into overlays. A key is `Event` or `Event:Tool`; a value is an overlay id or `clear`. These are the built-in triggers:

```json
{
  "PreToolUse:AskUserQuestion": "question",
  "PermissionRequest": "question",
  "Elicitation": "question",
  "PostToolUse:AskUserQuestion": "clear",
  "UserPromptSubmit": "clear",
  "Stop": "clear"
}
```

- `AskUserQuestion` is a tool, so it fires through `PreToolUse`. `Elicitation` is an MCP server asking for input.
- `PreToolUse` and `PostToolUse` need a tool (`Event:Tool`). A bare one is skipped, because it would run on every tool call.
- Event names are letters and digits; tool names may also use `_` and `-`. A value must be `clear` or a defined overlay. Anything else is skipped, because triggers are written into a shell script.
- Trigger changes apply at the next launch. Removing a trigger takes it out of the script then; its hook entry stays in Claude's settings and does nothing.

### The hooks Flow installs

At every launch Flow writes a hook script to `~/.flow/claude-hook.sh` and merges entries that run it into `~/.claude/settings.json`:

- the attention events `Notification`, `Stop`, `PermissionRequest`, `Elicitation` and `StopFailure`, which mark the pane's tab unread;
- `UserPromptSubmit` (a turn starts) and `PreCompact` (an automatic compaction, the hint that the context is nearly full), which mark nothing unread;
- `PreToolUse` for the `AskUserQuestion` tool (a question) and the `Bash` tool (which feeds the Shells tab);
- every event one of your triggers names, with a `matcher` for a tool-scoped key.

Besides raising overlays, these tell Snooze when a turn starts or ends, when Claude asks a question or for permission, when a turn stops on an error, and when the context is nearly full.

The merge is additive: your own hook entries are never removed or reordered, and a `settings.json` that does not parse is left untouched (no hooks are installed then). The script does nothing outside a Flow pane and always exits 0. For what the unread dot and Snooze do with these, see [Notifications and snooze](https://flow.worldbreakstudios.com/docs/workspace/notifications-and-snooze.md); for Claude Code setup, see [Claude Code](https://flow.worldbreakstudios.com/docs/cli/claude-code.md); for the Shells tab, see [Agent panes](https://flow.worldbreakstudios.com/docs/features/agent-panes.md).

## Check from a shell

```sh
flow-cli read icons
```

This prints the catalog as JSON: the icons (a built one's spec under `built`), the overlays, the triggers, whether tab icons are on, each pane's program and active overlay, and each session's stack.

## Settings and files

| Key or file | Type | Default | Effect |
|---|---|---|---|
| `appearance.tab_icons` | bool | `true` | Show tab icons; off restores plain glyphs, overlays stay |
| `appearance.tab_icon_favicon_ground` | bool | `true` | Colour a web tab's card from its favicon; off puts favicons on white |
| `~/.flow/icons/icons.json` | file | seeded with the built-ins | Icons, overlays, triggers |
| `~/.flow/claude-hook.sh` | file | written at launch | The Claude Code hook script; rewritten every launch |
| `~/.claude/settings.json` | file | Claude Code's | Gains Flow's hook entries at launch |

## Limits

- Programs on a remote host are not seen; those panes wear the shell icon.
- Overlay definitions and triggers are edited in `icons.json` only; Settings › Icons shows them read-only.
- Trigger changes need a relaunch; icon and overlay edits do not.
