@QingQ77: 在 tmux 里同时跑多个 Claude Code 会话,用一个弹出选择器就能看到每个会话的状态、实时预览,还能一键跳转。 https://github.com/craftzdog/tmux-claude-session-manager……
摘要
A tmux plugin that lets you run multiple Claude Code sessions in separate tmux windows, with a central fzf picker showing live status and previews, and the ability to jump between sessions.
查看缓存全文
缓存时间: 2026/06/17 18:01
在 tmux 里同时跑多个 Claude Code 会话,用一个弹出选择器就能看到每个会话的状态、实时预览,还能一键跳转。
https://github.com/craftzdog/tmux-claude-session-manager…
一个 tmux 插件,让你在多个项目目录下分别启动独立的 Claude Code 会话,每个会话跑在自己的 tmux 窗口里。按 prefix + u 会弹出一个 fzf 选择器,列出所有正在运行的 Claude 会话,每个会话旁边标注着实时状态( 工作中、 等权限、 空闲),还能看到屏幕预览。
craftzdog/tmux-claude-session-manager
Source: https://github.com/craftzdog/tmux-claude-session-manager
tmux-claude-session-manager
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 session. - 🟢 Live status per session —
working/waiting/idle— driven by Claude Code hooks, so you instantly see which need you. - 👁️ A live preview of each session’s screen right in the picker.
- 🎯 Smart jump — selecting a session 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 finished sessions from the picker.
Status is optional: without the hooks the picker still lists, previews, jumps,
and kills — sessions just show ? instead of a color.
Prerequisites
- tmux ≥ 3.2 (for
display-popup) - fzf — the picker UI
- Claude Code CLI (the
claudecommand) - 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) andprefix+u(list). If your config binds those elsewhere, either change the options below, or make sure the plugin loads after your own bindings (putrun '~/.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
| Key | Action |
|---|---|
prefix + y | Launch (or re-attach to) a Claude session for the current directory, in a popup |
prefix + u | Open the session picker |
Inside the picker:
| Key | Action |
|---|---|
enter | Jump to the session (switches to its origin window, resumes in the popup) |
ctrl-x | Kill the highlighted session |
↑ / ↓, type to filter | fzf navigation |
Sessions needing your attention (waiting, idle) sort to the top.
Status setup (optional, recommended)
Status comes from Claude Code hooks
that stamp each session’s state onto its tmux session. Add the following to your
Claude Code settings (~/.claude/settings.json), merging into any existing
hooks block. Adjust the path if your plugins live elsewhere (e.g.
~/.tmux/plugins/...):
{
"hooks": {
"UserPromptSubmit": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "$HOME/.config/tmux/plugins/tmux-claude-session-manager/scripts/state.sh working"
}
]
}
],
"Notification": [
{
"matcher": "permission_prompt",
"hooks": [
{
"type": "command",
"command": "$HOME/.config/tmux/plugins/tmux-claude-session-manager/scripts/state.sh waiting"
}
]
}
],
"PreToolUse": [
{
"matcher": "AskUserQuestion",
"hooks": [
{
"type": "command",
"command": "$HOME/.config/tmux/plugins/tmux-claude-session-manager/scripts/state.sh waiting"
}
]
}
],
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "$HOME/.config/tmux/plugins/tmux-claude-session-manager/scripts/state.sh idle"
}
]
}
]
}
}
The state machine:
| Event | State | Meaning |
|---|---|---|
UserPromptSubmit | 🔴 working | Busy — leave it |
Notification (permission) | 🟡 waiting | Needs permission |
PreToolUse (AskUserQuestion) | 🟡 waiting | Asking you a question |
Stop | 🟢 idle | Turn finished — your move |
Claude Code reloads
hooksdynamically — no restart needed. Sessions that are already running start reporting status on their next event once the hooks are added.
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_session_prefix 'claude-' # tmux session name prefix
set -g @claude_popup_width '90%' # popup width
set -g @claude_popup_height '90%' # popup height
How it works
- The launcher creates a detached
claude-<hash-of-dir>tmux session runningclaude, records the window it came from in@claude_origin, and attaches to it in a popup. - The hooks set
@claude_state/@claude_state_aton each session as Claude works. - The picker lists sessions matching the prefix, reads their state and a live
capture-panepreview, and on selection moves your client to the session’s origin window before resuming it in the popup. - Pressing
prefix+ufrom 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.
License
MIT © Takuya Matsuyama
相似文章
@trq212: Agent View 是 Claude Code 原生管理多会话的最佳方式,就像为 Claude Code 量身定制的 tmux。我们花了很…
有用户指出,'Agent View' 是 Claude Code 中用于管理多会话的原生功能,并将其比作 tmux。
@Justin1024go: 来了,终于来了,适合Claude Code、OpenCode、Codex编码的终端 MUX0 开源发布了~ - 侧边栏管理、tab项管理、终端内部分割 - Claude Code、OpenCode、Codex运行状态显示 - 使用ghos…
MUX0, an open-source terminal multiplexer optimized for Claude Code, OpenCode and Codex, launches with sidebar/tab management, pane splitting and real-time AI status display.
@FinanceYF5: Claude Code 新增的 agent view,像是给多代理工作流装了一个“控制塔”。 以前要开多个终端、tmux、靠脑子记进度。 现在一个列表就能看清:谁在跑、谁等你输入、谁已经完成。
Claude Code新增了agent view功能,提供了一个集中控制面板,让开发者可以一目了然地查看多个代理的工作状态(运行中、等待输入、已完成),优化了多代理工作流的管理。
Multi-Claude
Multi-Claude 是一款 Mac 工具,允许用户同时运行多个 Claude AI 账户以进行并排使用。
@tom_doerr: 在 tmux 中全天候运行 Claude agent https://github.com/Jedward23/Tmux-Orchestrator…
Tmux-Orchestrator 是一款开源工具,通过 tmux 会话内的多 agent 层级结构,实现 Claude AI agent 的自主全天候运行,支持并行项目管理与编码。
