Skip to main content
  1. Posts/

Running Several AI Coding Agents Without Losing Track

··875 words·5 mins·
Nick Liu
Author
Nick Liu
Building infrastructure for Facebook Feed Ranking at Meta. Previously at Walmart, Twitter, AWS, and eBay. MS in Computer Science at Georgia Tech.
Table of Contents
Taming Claude Code Sessions - This article is part of a series.
Part 4: This Article
Once you're comfortable with AI coding agents, you start running several at once: one refactoring here, one writing tests there, one stuck waiting for your approval. Keeping them straight is its own little skill.
Tested with Claude Code 2.1.x · macOS / Linux

Here are two ways to do it: a lightweight tmux plugin, and (briefly) dedicated “AI terminal” apps.

Option A: a tmux plugin (lightweight, works over SSH)
#

tmux-claude-session-manager adds two keystrokes to tmux:

  • prefix + y: launch (or jump back to) a Claude session for the current folder.
  • prefix + u: open a searchable picker of your live Claude sessions, showing each one’s status (🔴 working / 🟡 waiting for you / 🟢 idle) plus a live preview, with the ones needing attention sorted to the top.

It uses fzf (a fast fuzzy finder) for the picker, so you just start typing to filter.

Installing it (with TPM)
#

Most people manage tmux plugins with TPM, the Tmux Plugin Manager. If you don’t have it yet:

git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

…and add this near the bottom of ~/.tmux.conf (it must come before the TPM run line):

run '~/.tmux/plugins/tpm/tpm'

Now add the plugin. Put this line above that run line:

set -g @plugin 'craftzdog/tmux-claude-session-manager'

Reload tmux (prefix + r or tmux source-file ~/.tmux.conf), then press prefix + I (capital i) to install. Done. prefix + y and prefix + u now work. You’ll also need fzf installed (brew install fzf).

Making the status dots light up
#

The picker can show working/waiting/idle, but it needs to know the state. It learns this from Claude Code hooks (we met hooks in Part 2). The plugin ships a tiny script, scripts/state.sh, that you wire into a few hook events in ~/.claude/settings.json:

{
  "hooks": {
    "UserPromptSubmit": [
      { "matcher": "", "hooks": [ { "type": "command",
        "command": "~/.tmux/plugins/tmux-claude-session-manager/scripts/state.sh working" } ] }
    ],
    "Notification": [
      { "matcher": "permission_prompt", "hooks": [ { "type": "command",
        "command": "~/.tmux/plugins/tmux-claude-session-manager/scripts/state.sh waiting" } ] }
    ],
    "Stop": [
      { "matcher": "", "hooks": [ { "type": "command",
        "command": "~/.tmux/plugins/tmux-claude-session-manager/scripts/state.sh idle" } ] }
    ]
  }
}

(Merge these into any hooks you already have rather than replacing the whole block.) Translation: “when I submit a prompt → mark working; when Claude asks permission → waiting; when it stops → idle.” Now the dots are live. The three hook events drive a simple state machine:

stateDiagram-v2
    [*] --> working: UserPromptSubmit
    working --> waiting: Notification
(permission_prompt) waiting --> working: you approve working --> idle: Stop idle --> working: UserPromptSubmit note right of working : 🔴 running note right of waiting : 🟡 needs you note right of idle : 🟢 done
Heads-up on hooks and trust. You’re telling Claude Code to run a third-party script on its lifecycle events. Read state.sh first (it’s short; it just records a status into a tmux variable). Only wire in hooks you understand and trust.

Why this is great for remote servers
#

If you SSH into a remote machine and run Claude in tmux there, this plugin runs on that machine, so your picker and status work on the remote too. That’s a big deal: GUI-based managers on your laptop can’t see what’s happening inside an SSH session, but a tmux plugin lives right where the agents do.

Option B: a dedicated “AI terminal” app
#

There’s a newer category of macOS apps built specifically for running many agents in parallel, with sidebars showing each agent’s status, git branch, and so on. Two popular ones:

  • cmux: a native macOS terminal for parallel AI agents (vertical tabs, per-pane notifications). Unrelated to tmux despite the name.
  • Supacode: a terminal “command center” (built on Ghostty’s engine) that runs each agent in its own isolated git worktree, with GitHub integration for opening PRs and reviewing CI checks.

These are slick and worth a look if you do a lot of local, parallel, many-agents-on-one-repo work.

tmux vs. a dedicated app: how to choose
#

If you… Lean toward
Mostly work on remote servers over SSH tmux (the app can’t reach remote agents)
Already love tmux + your shell setup tmux (keep your muscle memory)
Want sessions to survive disconnects tmux (built-in; reattach any time)
Do bursts of 3+ local agents on one repo a dedicated app can shine
Want zero terminal config, a GUI sidebar a dedicated app

There’s no wrong answer, and they’re not exclusive. You can keep tmux as home base and trial a dedicated app for heavy local days. For my own SSH-heavy workflow, staying in tmux won out.

The whole series, in one breath
#

  1. Part 1: Find them

    1 / 4

    Sessions live in ~/.claude/projects; find them with claude -rCtrl+A. Read →
  2. Part 2: Name them

    2 / 4

    A SessionStart hook auto-names sessions so search actually works. Read →
  3. Part 3: Label tmux

    3 / 4

    A shell wrapper + set-titles label your tmux window and terminal tab. Read →
  4. Part 4: Juggle many

    4 / 4

    A tmux plugin (or a dedicated app) helps you manage many live agents. (this post)

Put together, you go from “where did that conversation go?” to “type three letters, hit Enter, back in business.” Happy hacking.

Taming Claude Code Sessions - This article is part of a series.
Part 4: This Article

Related

Make tmux Show What Each Window Is Doing

··779 words·4 mins
If you use tmux, you've hit this: ten windows open and they're all named `zsh` or `node`. Which one had your AI agent running? No idea. Let's make tmux label windows usefully. Taming Claude Code Sessions · Part 3 of 4 1 2 3 4 🧪 Tested with Claude Code 2.1.x · macOS / Linux New to tmux? It’s a “terminal multiplexer”: it splits one terminal into many windows and panes that survive disconnects. The only vocabulary you need here: a window is like a browser tab inside tmux; the bar at the bottom lists them. The prefix is the key you press before a tmux command, commonly Ctrl+b (mine is Ctrl+a). Why everything is named zsh # By default tmux has a setting called automatic-rename turned on. It renames each window after whatever program is running in it. A shell? zsh. A Node program (like Claude Code)? node. Helpful in theory, useless when everything collapses to the same word.

Stop Losing Your Claude Code Conversations

··623 words·3 mins
You're deep in a great Claude Code conversation. You close the terminal. The next day you want to pick up where you left off… and you can't find it. Sound familiar? Let's fix that. Taming Claude Code Sessions · Part 1 of 4 1 2 3 4 🧪 Tested with Claude Code 2.1.x · macOS / Linux What is a “session,” and where does it go? # Every time you run claude, you start a session, one conversation, with its full history. When you quit, that history doesn’t vanish. Claude Code saves it to disk, organized per project folder, here:

Your First Claude Code Hook: Auto-Name Every Session

··886 words·5 mins
In Part 1 we learned that named sessions are easy to find. Now let's make naming automatic with a hook. This is also a perfect first hook project, so I'll explain the whole idea from scratch. Taming Claude Code Sessions · Part 2 of 4 1 2 3 4 🧪 Tested with Claude Code 2.1.x · macOS / Linux Part 1 left us with one chore: you still have to remember to name your sessions. Let’s delete that chore.