Skip to main content

unit tests

AgentCommandTab

A macOS menu bar app that lists the iTerm2 windows and tabs where AI coding agents run (Claude Code, OpenAI Codex CLI, and others), shows what each agent is doing, and lets you rename, focus, reorder and move those tabs without interrupting the agents. The list shows as a dropdown under the menu bar icon, a sidebar at the edge of the screen, or a regular window.

What it does

  • One tree of your agents: every iTerm2 window with at least one agent tab, with its tabs below it, grouped by monitor when you have several. Tabs without an agent are left out.
  • What each agent is doing: a status dot and word per tab (asking for permission, thinking, running a tool, stuck, running in the background, done, idle, error), how long it has been so, the context size in tokens, and optionally when it started, its memory and CPU use. "Done" stays until you look at the tab. The menu bar icon counts the agents waiting for your answer.
  • A preview per tab: what the agent is asking or running, what it said since your last prompt, or that prompt. Open it with the tab's arrow.
  • Control: double-click to bring a window or tab to the front; press and hold to peek at a tab; rename in place; drag tabs between windows and windows between monitors; start a new agent window or tab; duplicate a tab; type /compact or /clear into an agent waiting at its prompt; end an agent's process; pause agents (with every process they started) before going offline and resume them later, per tab, window, monitor or all at once. Select several rows (Command-click, Shift-click) to act on all their agents at once (a busy agent gets /compact or /clear when its turn ends), or to ask them to talk to each other: each gets your note and how to message the others.
  • Sort and filter: sort by activity, name, start time, memory or CPU use, or keep iTerm2's order; hide the idle tabs with one click.
  • Your choice of view: a dropdown under the menu bar icon, a sidebar that hides at the screen's edge or stays visible (optionally keeping iTerm2 windows out of its way), or a regular window (optionally always on top).
  • A shortcut from any app: Shift-Command-Tab (or Command-Fn-Tab, chosen in Settings) shows the list, and hides it when pressed again. While macOS's app switcher is open, the keys still go to it.

Requirements

  • macOS, with iTerm2 3.7 or later and iTerm2's Python API turned on: iTerm2 > Settings > General > Magic > Enable Python API.
  • Python 3.10 or later (for an install with pip or pipx).

Install

pipx install agent-command-tab        # or: pip install agent-command-tab
brew install bw2/tap/agent-command-tab   # Homebrew adds the bw2/tap repository by itself

From a clone of this repository:

python3 -m venv .venv && .venv/bin/pip install -e .

Use

agent-command-tab                # the menu bar app; restarts itself if iTerm2's connection drops
agent-command-tab dump-snapshot  # prints the current list as JSON
agent-command-tab install-hooks  # adds the app's hooks to Claude Code's and Codex's settings (remove-hooks takes them out)
agent-command-tab --version      # prints the installed version, for bug reports

Click the "C" in the menu bar to see the list, right-click it for Settings. The first time, iTerm2 asks whether to allow the app to use its Python API.

From its first start on, iTerm2 starts the app whenever iTerm2 starts: the app adds AgentCommandTab.scpt to iTerm2's AutoLaunch folder (~/Library/Application Support/iTerm2/Scripts/AutoLaunch), which starts the copy you ran, however you installed it. Started that way, it has iTerm2's permissions, as when you start it from an iTerm2 tab. Settings > Start with iTerm2 turns that off and removes the script. Only one copy runs at a time; starting another prints that one is already running. Before uninstalling, turn Start with iTerm2 off and run agent-command-tab remove-hooks, since pip and Homebrew leave the script and the hooks behind.

The app's hooks tell a crashed agent from one that ended normally (its row stays, gray and "exited", for 5 minutes), and count Claude Code's background shells and agents. The list offers to install them (Install Hooks, at its bottom left) while an agent tool in it lacks them. Each settings file is copied to <file>.agent-command-tab-backup first. Sessions started afterwards use them, and Codex asks you to approve them first: type /hooks in Codex.

The shortcut needs the Accessibility permission (System Settings > Privacy & Security > Accessibility), because it has to see the keys before macOS's app switcher does. macOS gives it to the app that starts AgentCommandTab, so started from iTerm2, turn it on for iTerm2. Until it is on, Settings show a button that opens that page.

Development

.venv/bin/python -m unittest discover -s tests -p '*_tests.py'

docs/RELEASING.md describes how to publish a version.

License

MIT; see LICENSE. The app uses iTerm2's iterm2 Python package, which is licensed GPL-2.0-or-later. pip and the Homebrew formula install it alongside as a separate package.

Metadata

Release files for agent-command-tab 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-command-tab 0.1.0
File Size Uploaded Provenance Actions
agent_command_tab-0.1.0.tar.gz 210.6 kB Without provenance Details for agent_command_tab-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agent-command-tab 0.1.0
File Interpreter ABI Platform Actions
agent_command_tab-0.1.0-py3-none-any.whl Python 3 none any Details for agent_command_tab-0.1.0-py3-none-any.whl

Total release size: 445.4 kB

Release files / agent_command_tab-0.1.0.tar.gz

Download URL agent_command_tab-0.1.0.tar.gz
Size 210.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c8c56b1e03dac513b49e3d0f0e0a01ac653388432187dfcd96f8940afa96ea99
BLAKE2b-256 checksum
How to use checksums
4b99e0fa53c012452b7ed176937d1f679f3b6439b9cee76098200a6dd42f0cae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release files / agent_command_tab-0.1.0-py3-none-any.whl

Download URL agent_command_tab-0.1.0-py3-none-any.whl
Size 234.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca8653e9c1d4472c3e86a83edf80006fca73e49e68091b0fe05247b5fc8dd5d4
BLAKE2b-256 checksum
How to use checksums
ee7ddd82b30569ec6a910aedcb34be72012cf71c51181606d3f40b817962d78b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Security for agent-command-tab 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page