This morning I counted 27 iTerm2 sessions across 8 windows. Eight of them ran Claude Code. One was waiting for a permission prompt, and I only found it by clicking through windows. So I built a small menu bar item that answers one question: which Claude needs me now?
The data was already there
iTerm2 ships its own Claude Code hook, cc-status, and a CLI called it2. I already had the hook in my Claude Code settings, so every session reports a state: waiting, working, done or idle, plus a short status line. it2 session list --json gives every session, and it2 session get-status gives its state. The plugin only has to ask and print.
flowchart LR
A["Claude Code hooks"] --> B["cc-status"]
B --> C["iTerm2 session state"]
C --> D["it2 CLI"]
D --> E["SwiftBar plugin<br/>every 10 s"]
E --> F["Menu bar 🤖 4 ⏳1"]
SwiftBar runs any script in a folder and turns its output into a menu. Mine is one Python file, iterm-sessions.10s.py. The 10s in the name is the refresh time. One run takes about 1.5 seconds, because it asks for 27 statuses in parallel.

Clicking a row was the real work
A list you can't click is only half the tool. I wanted a click to jump to that tab. It took five tries.
| Try | What it did | Result |
|---|---|---|
it2 session focus | Selects the session inside iTerm2 | Window stayed behind |
AppleScript select window | Asks iTerm2 to raise the window | Index stayed at 7 |
it2 app activate | iTerm2 activates itself | Ignored after a menu click |
open -a iTerm | Activates through Launch Services | iTerm2 in front, wrong window |
| Window menu item ⌥⌘N | Clicks it through System Events | Works |
The log file saved me here. Every click wrote a line, so I could see that the clicks arrived and every command returned 0. Nothing failed, the window just didn't move. Then it2 window list --json showed "is_fullscreen": true on most windows.
A fullscreen window on macOS is its own Space. iTerm2 can select a window on another Space, but it can't bring it to the front. The Window menu (⌥⌘1 to ⌥⌘9) can, because that is the same path a person takes.
The session variable \(tab.window.number) gives the number behind the shortcut. The click then runs a short AppleScript that finds the menu item ending in "⌥⌘N" and clicks it, and it2 session focus picks the right pane. SwiftBar needs Accessibility access for this, and it only reaches windows 1 to 9.
Three smaller traps
iTerm2 leaves session.path empty while Claude runs. I read the cwd of the claude process on the tab's tty with lsof instead.
SwiftBar trims leading spaces, wide ones too. A word joiner (U+2060) first keeps the spaces after it.
SwiftBar reads | as the start of parameters. A folder name with a pipe could add a command, so every field is cleaned.
One more: SwiftBar runs every file in its plugin folder as a plugin. My AppleScript first lived in a separate file, so I moved it inside the Python script as a string.
What it took
About an hour and a half, most of it on the click. The list worked in the first ten minutes. If I did it again, I would check is_fullscreen before trying any focus command, and I would add the click log on day one instead of after the second "nothing happens".

Related notes
Adding song BPM lookup to Tempus Metronome
What BPM means, and how I added the GetSongBPM API to my Flutter metronome app Tempus so a song search sets the tempo.
A KSeF MCP server in an afternoon, for three companies at once
I built a small MCP server for KSeF, the Polish e-invoicing system, so Claude can list and download invoices for my three companies. The login flow is short, and the one trap is that every token belongs to exactly one company.



