tmux-claude-session-manager

作者 craftzdog已验证

Run many Claude Code sessions across your projects, each in its own tmux session — then list them, see which are done vs. still working, and jump to one from a single popup.

367
Stars
47
Forks
Shell
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/craftzdog/tmux-claude-session-manager

快速入门

使用 tmux-claude-session-manager 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

tmux-claude-session-manager

screenshot

Run many Claude Code sessions across your projects, each in its own tmux session — then list them, see which are done vs. still working, and jump to one from a single popup.

If you launch Claude per-directory (one nested session per project), you quickly end up with a dozen of them and no way to tell which are finished without opening each one. This plugin gives you:

  • 🔢 A central picker (prefix + u) listing every running Claude agent — several in one project, and any running loose in an ordinary pane.
  • 🟢 Live status per agent — working / waiting / idle — read straight from claude agents --json, so you instantly see which need you. No setup.
  • 👁️ A live preview of each agent's screen right in the picker.
  • 🎯 Smart jump — selecting an agent switches your client to the window it was launched from, then resumes it in a popup over it.
  • 🚀 A launcher (prefix + y) that opens/attaches a Claude session for the current directory.
  • Quick kill (ctrl-x) of a finished agent from the picker.
  • 🔔 Bell forwarding — a bell in a dedicated session highlights the window you launched it from, so you notice even without opening the picker (one-time Claude Code setup).

Status needs no configuration. Claude Code publishes each agent's own state and the picker reads it — there are no hooks to install.

Prerequisites

  • tmux ≥ 3.2 (for display-popup)
  • fzf — the picker UI
  • jq — parses claude agents --json
  • Claude Code ≥ 2.1.139 — for the claude agents command (claude --version to check)
  • bash; macOS or Linux

Install (tpm)

Add to ~/.tmux.conf (or ~/.config/tmux/tmux.conf):

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

Then hit prefix + I to install.

Keybinding note: by default the plugin binds prefix + y (launch) and prefix + u (list). If your config binds those elsewhere, either change the options below, or make sure the plugin loads after your own bindings (put run '~/.tmux/plugins/tpm/tpm' after them) so the one you want wins.

Manual install

git clone https://github.com/craftzdog/tmux-claude-session-manager ~/clone/path

Add to ~/.tmux.conf, then reload (prefix + r or tmux source ~/.tmux.conf):

run-shell ~/clone/path/claude_session_manager.tmux

Usage

KeyAction
prefix + yLaunch (or re-attach to) a Claude session for the current directory, in a popup
prefix + dClose the popup and go back to your window, Claude session keeps running
prefix + uOpen the agent picker

Inside the picker:

KeyAction
enterJump to the agent (see How it works)
ctrl-xKill the highlighted agent
/ , type to filterfzf navigation

Agents needing your attention (waiting, idle) sort to the top.

Every running Claude gets its own row — the picker identifies each by its process, not by its tmux session. So several agents in one project all show up separately, as does a Claude you started by hand in an ordinary pane.

Options

Set any of these before the plugin loads (defaults shown):

set -g @claude_launch_key     'y'        # prefix key: launch/open for current dir
set -g @claude_list_key       'u'        # prefix key: open the picker
set -g @claude_command        'claude'   # command run in new sessions
set -g @claude_args           ''         # extra args appended to the command
set -g @claude_session_prefix 'claude-'  # tmux session name prefix
set -g @claude_popup_width     '90%'     # popup width
set -g @claude_popup_height    '90%'     # popup height
set -g @claude_fzf_options    ''         # extra options passed to the fzf picker
set -g @claude_forward_bell   'on'       # highlight the origin window on a bell

For example, to skip permission prompts in launched sessions:

set -g @claude_args '--dangerously-skip-permissions'

Making Claude ring the bell

bell-forwarding

Forwarding relays a bell; it cannot create one. Claude Code has to emit it, and two settings decide that — they live in different files.

How it notifies — ~/.claude/settings.json:

{
  "preferredNotifChannel": "terminal_bell"
}

Only terminal_bell and iterm2_with_bell write a real \a. iterm2, kitty and ghostty send escape sequences that tmux does not count as a bell, notifications_disabled sends nothing, and the default auto picks by terminal — so pin it.

When it notifies — ~/.claude.json, the global config (settings.json ignores this key and drops it silently):

{
  "messageIdleNotifThresholdMs": 0
}

Claude rings once it has sat idle this long. The default is 60000, long enough that you'd normally have gone back to look before it fires; 0 rings the moment a turn ends.

Or ring it from a hook

A hook does the same job, and is the way to keep the bell while pointing preferredNotifChannel at an OS-notification channel instead. In ~/.claude/settings.json:

{
  "hooks": {
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "printf '\\a' > /dev/tty 2>/dev/null || { [ -n \"$TMUX_PANE\" ] && printf '\\a' > \"$(tmux display-message -p -t \"$TMUX_PANE\" '#{pane_tty}' 2>/dev/null)\" 2>/dev/null; } || true"
          }
        ]
      }
    ]
  }
}

Stop fires the moment a turn ends, with no idle timer involved. The bell goes to /dev/tty — the hook's controlling terminal, which inside tmux is the pane's own pty, exactly where Claude's built-in bell would land. The $TMUX_PANE branch covers a hook running without a controlling terminal, resolving the pane's tty through tmux instead; the trailing || true keeps a failed bell from failing the hook.

Use the same command under Notification with the permission_prompt matcher to ring when Claude asks for permission, or under PreToolUse matching AskUserQuestion to ring when it asks you a question.

Customizing the fzf picker

@claude_fzf_options is passed straight to fzf, so you can add your own bindings.

Here is a vim keybinding example:

set -g @claude_fzf_options "\
  --prompt 'nav> ' \
  --bind 'j:down' \
  --bind 'k:up' \
  --bind 'q:abort' \
  --bind 'x:execute-silent(kill {3})+reload(sleep 0.3; \$CLAUDE_PICKER --list)' \
  --bind 'i:unbind(j,k,q,i,a,x)+change-prompt(filter> )' \
  --bind 'a:unbind(j,k,q,i,a,x)+change-prompt(filter> )' \
  --bind 'esc:rebind(j,k,q,i,a,x)+change-prompt(nav> )'"

The picker opens in nav mode:

KeyAction
j / kmove down / up
i / aswitch to filter mode — type to fuzzy-match
xkill the highlighted agent (like the built-in ctrl-x)
qclose the picker
enterjump to the agent (both modes)
escfilter mode → back to nav

Only the bound keys are special in nav mode; any other key still filters as you type. x reloads the list through $CLAUDE_PICKER, a path the picker exports for exactly this — write it as \$CLAUDE_PICKER inside the double-quoted value above so tmux stores a literal $ (in a single-quoted value, use a bare $CLAUDE_PICKER).

How it works

  • The launcher creates a detached claude-<hash-of-dir> tmux session running claude, records the window it came from in @claude_origin, and attaches to it in a popup.
  • claude agents --json is the source of truth for what is running and how it is doing. Each Claude session self-reports its state (busy / waiting / idle) to a supervisor daemon, which that command publishes. Nothing here scans processes for a claude command name — on macOS a pane reports its parent shell, never the claude child running inside it.
  • agents.sh pairs each running Claude with the tmux pane it occupies by joining pidtty → pane. That join is why identity is the Claude process rather than the tmux session, and therefore why several agents in one project each get their own row. It costs three subprocesses per render, whatever the number of sessions or panes.
  • The age column is the mtime of the agent's transcript — its last sign of life. claude agents --json reports only startedAt, never a last-activity time. A brand-new agent that has yet to take a turn shows -.
  • The picker renders those rows with a live capture-pane preview. On enter a dedicated agent (in a claude-* session) resumes in the popup over the window it was launched from, while a loose one (any other pane) is focused in place. ctrl-x kills the Claude process itself: a dedicated session dies with its last window, and a loose pane keeps the shell that hosted it.
  • Pressing prefix + u from inside a session popup detaches that popup first (closing it), then reopens the picker full-size on the outer host client — so you never end up with a cramped popup-in-popup.
  • Bell forwarding: a dedicated session is a separate tmux session, so a bell inside one is invisible to the window that launched it — tmux's own bell handling only looks within a single session's windows. A global alert-bell hook catches every bell server-wide, and for one from a claude-* session, bell.sh writes it into the origin window's own pane. tmux then treats it as if that pane rang the bell itself: the origin window gets the normal window-status-bell-style highlight, and if it's the window currently on screen (or bell-action is set to relay background bells), your terminal's own bell/tab indicator fires too. What rings in the first place is Claude Code's own notification config — see Making Claude ring the bell. Set @claude_forward_bell 'off' to disable.

License

MIT © Takuya Matsuyama

常见问题

What is tmux-claude-session-manager?

tmux-claude-session-manager is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by craftzdog. Run many Claude Code sessions across your projects, each in its own tmux session — then list them, see which are done vs. still working, and jump to one from a single popup. It has 367 GitHub stars.

Is tmux-claude-session-manager safe to use?

Yes. tmux-claude-session-manager passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install tmux-claude-session-manager?

Clone the repository with "git clone https://github.com/craftzdog/tmux-claude-session-manager" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is tmux-claude-session-manager written in?

tmux-claude-session-manager is primarily written in Shell. It is open-source under craftzdog on GitHub, so you can review or fork the full source.

Are there alternatives to tmux-claude-session-manager?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh tmux-claude-session-manager against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情