Black flat screen computer monitor displaying code in a dark environment

How to Get Notified When AI Agents Need Your Attention in iTerm2

Running AI coding agents across multiple terminal tabs means lost time when you miss a prompt. A three-minute iTerm2 configuration gives you native macOS notifications whenever an agent finishes and waits for input.

9 February 20265 min readBy LibraBit Team

If you run AI coding agents like Claude Code, Codex, Aider, or similar across multiple terminal tabs, you've probably had this happen. You kick off a task in one tab, switch to another to do something else, and twenty minutes later you realise the first agent has been waiting for your input the whole time, which is time you won't get back.

iTerm2, the popular macOS terminal replacement, has notification support built in that sorts this out. A three-minute configuration change gives you native macOS notifications whenever a tab goes idle or rings the terminal bell, which is what happens when an AI agent finishes its work and waits for your next instruction. Here's how to set it up.

Why this matters

Running AI agents in parallel is a good way to get more done as a developer. You might have Claude Code refactoring a module in one tab, running a test suite in another, and reviewing a pull request in a third. Most of the time the slow part is you, because you haven't noticed that one has finished.

That adds up quickly. If you miss a prompt for even five minutes per task across a dozen interactions per day, that's an hour of wasted time, and across a team it soon becomes a lot.

You don't need any third-party tools, scripts, or complex hook configurations for this, because iTerm2 does it on its own.

Step-by-step setup

1. Open iTerm2 settings

Open iTerm2 and press ⌘, (Cmd + comma) or go to iTerm2 > Settings in the menu bar.

2. Navigate to Profiles > Terminal

Click the Profiles tab at the top of the settings window, then select the Terminal sub-tab.

This panel controls bell behaviour, notification settings, and shell integration options for your terminal profile.

iTerm2 Settings showing the Profiles > Terminal panel with bell and notification options

3. Enable Notification Center Alerts

In the Terminal settings panel, find the Notifications section and tick the checkbox labelled Notification Center Alerts. This is the main switch that lets iTerm2 send macOS notifications.

4. Configure which alerts to send

Click the Filter Alerts button next to the Notification Center Alerts checkbox. A modal will appear with several options. Enable the following:

  • Send "Bell" alert, which triggers when the terminal bell rings (agents often ring the bell when they complete a task or need input)
  • Send "Idle" alert, which triggers when a session has been idle for a period, meaning the agent has stopped producing output and is likely waiting for you
The Filter Alerts modal showing Bell and Idle alert options enabled

The other options, "Session Ended", "New Output", and escape sequence alerts, are less useful for AI agent workflows, but you can enable them if your use case requires it.

5. Configure bell preferences

Back in the main Terminal settings panel, configure the Bell settings to suit your workflow:

  • Silence bell: tick this to prevent the audible beep every time an agent triggers the bell. We'd recommend it if you're running multiple agents, unless you enjoy a cacophony of terminal beeps.
  • Flash visual bell: provides a subtle visual flash instead of sound. This is handy if you're looking at the terminal when the bell fires.
  • Show bell icon in tabs: this is the most useful bell setting. When it's on, iTerm2 shows a small bell icon (🔔) in the tab title bar whenever a bell is triggered in that tab, so you can glance across all your tabs and see which agents need attention.

6. Verify macOS notification settings

For iTerm2 notifications to appear, macOS itself needs to have notifications enabled for the app. Open System Settings > Notifications, search for iTerm2, and ensure:

  • Allow notifications is turned on
  • Your preferred alert style is selected (Temporary or Persistent)
  • Play sound for notification is toggled to your preference
macOS System Settings showing notification preferences for iTerm2

If you prefer notifications to stay on screen until you dismiss them, choose Persistent as the alert style. For a brief banner that disappears automatically, choose Temporary.

What it looks like in practice

Once it's set up, here's what you'll see when an agent finishes its work and waits for input.

The tab indicator

When an agent triggers the bell, a bell icon appears in the tab bar next to the session name, so you can see at a glance that something in that tab needs you.

iTerm2 tab showing a bell icon indicating the agent needs attention

Compare this with a tab where no bell has been triggered, and you can see the difference straight away:

iTerm2 tab without a bell icon, no action needed

The macOS notification

At the same time, macOS shows a notification banner. This appears even when iTerm2 isn't the active application, so you'll get alerted whether you're in your browser, an IDE, or any other app.

macOS notification banner showing that an iTerm2 session has become idle

The notification shows you which session triggered it and why (idle, bell, etc.), so you know which tab to switch to.

Fine-tuning your setup

Silencing the audible bell

If you have multiple agents running, the default terminal bell sound gets annoying quickly. The "Silence bell" checkbox in the Terminal settings turns off the sound but keeps the tab icon and the macOS notifications, which is the setup we'd suggest when you're running several agents.

Customising notification sounds

In macOS System Settings > Notifications > iTerm2, you can toggle Play sound for notification on or off independently from the terminal bell sound. So you can silence the terminal beep and still get one notification sound from macOS, rather than a string of beeps.

Alert on Next Mark

iTerm2 has another handy feature for long tasks: Alert on Next Mark. Press ⌥⌘A (Option + Cmd + A) after kicking off a long process, and iTerm2 will send a notification when the next shell prompt appears (the "mark"). It's good for one-off commands like test suites or build processes, though it's less practical for ongoing agent conversations where you want it watching all the time.

Alternative: Claude Code notification hooks

If you use a terminal other than iTerm2, or want more control over when notifications fire, Claude Code supports notification hooks. These are shell commands that run when specific Claude Code events happen.

You can configure hooks in ~/.claude/settings.json with matchers for idle_prompt (Claude is waiting for your next instruction) and permission_prompt (Claude needs approval to run a command). Tools like terminal-notifier on macOS can then send native notifications from any terminal application.

The iTerm2 approach in this article is built into the terminal and needs no extra software. It also works with any AI agent or CLI tool, where the hooks only cover Claude Code.

Key takeaways

Setting up iTerm2 notifications takes under three minutes, and it gets rid of the biggest source of wasted time when you work with AI coding agents in parallel, which is not knowing when they need you.

So turn on the bell and idle alerts, silence the audible bell, and let macOS notifications tell you when an agent is waiting. If you use Claude Code in a terminal other than iTerm2, the notification hooks above are the next thing to try.


References