Skip to content

dapperlabs/autotabs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

autotabs

Smart tab management for AI-heavy terminal workflows. An iTerm2 plugin that monitors your tabs, detects which AI agents need your attention, and surfaces them.

If you run 20 Claude Code sessions at once, autotabs tells you which 5 actually need you right now.

How it works

autotabs polls each tab every 1.5 seconds, reads the terminal buffer, and classifies the session into one of four states:

Badge Color State Meaning
⚠ INPUT Red INPUT Agent is blocked waiting for your response (permission prompt, Y/n, question)
⚡ ACTIVE Blue ACTIVE Output is streaming — agent is working
● READY Green READY Claude prompt is open, waiting for your next command
○ IDLE Gray IDLE Plain shell prompt, nothing running

Each tab gets a colored badge so you can visually scan all your tabs instantly.

Install

git clone https://github.com/roham/autotabs.git
cd autotabs
./install.sh

Then:

  1. iTerm2 → Settings → General → Magic → Enable Python API
  2. Restart iTerm2

Auto-reorder (opt-in)

By default, autotabs only paints badges and colors. To have tabs physically sort by priority (INPUT tabs float left, IDLE tabs sink right):

Edit autotabs.py and set:

AUTO_REORDER = True

Or bind a hotkey to toggle it live:

  • iTerm2 → Settings → Keys → add shortcut → Action: "Invoke Script Function"
  • Function: autotabs_toggle_reorder()

The tab you're currently looking at never moves (controlled by PROTECT_FOCUSED = True).

Detection patterns

autotabs detects agent state by pattern-matching the last 8 lines of terminal output:

INPUT (agent blocked on you):

  • Claude Code permission prompts (Allow / Deny)
  • Confirmation prompts (Y/n, Press Enter)
  • Password/passphrase prompts

ACTIVE (agent working):

  • Screen content changed in the last 3 seconds

READY (Claude waiting for command):

  • Bare > or prompt with cursor at bottom

IDLE (shell):

  • Standard $ / % / # prompt

You can add your own patterns by editing the INPUT_PATTERNS, CLAUDE_PROMPT_PATTERNS, and SHELL_PATTERNS lists in autotabs.py.

Config

All config is at the top of autotabs.py:

POLL_INTERVAL = 1.5        # seconds between scans
ACTIVITY_TIMEOUT = 3.0     # seconds of no change → not "active"
AUTO_REORDER = False        # tabs auto-sort by priority
REORDER_COOLDOWN = 3.0     # min seconds between reorders
PROTECT_FOCUSED = True     # never move the focused tab
NOTIFY_ON_INPUT = True     # set session variable on INPUT transition

Roadmap

  • Tab grouping (cluster related agent sessions)
  • Tab minimize (collapse idle tabs to a compact strip)
  • Bookmarks (snapshot + restore a session's state)
  • Sound/notification on INPUT transition
  • Support for non-Claude agents (Copilot, Cursor, aider, etc.)

Some of these will require forking iTerm2 for native UI changes. The Python API can only go so far.

License

MIT

About

Smart tab management for AI-heavy terminal workflows. iTerm2 plugin that detects which agent tabs need your attention.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors