npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

purplemux

v0.3.0

Published

Manage multiple Claude Code sessions from your browser

Downloads

3,339

Readme

purplemux

Claude Code,多項任務同時進行。更快速。

一個畫面縱覽所有工作階段,在手機上也毫無中斷。

繁體中文 | English | 한국어 | 日本語 | 简体中文 | Deutsch | Español | Français | Русский | Português (Brasil) | Türkçe

purplemux

purplemux mobile

安裝

npx purplemux@latest

在瀏覽器中開啟 http://localhost:8022。完成。

需要 Node.js 20+ 與 tmux。macOS 或 Linux。

想用原生應用程式?可從最新發行版下載 macOS Electron 版(適用於 Apple Silicon 與 Intel 的 .dmg)。

為什麼選擇 purplemux

  • 多工作階段儀表板 — 一眼掌握所有 Claude Code 工作階段的「執行中 / 等待輸入」狀態
  • 速率限制監控 — 顯示 5 小時 / 7 天剩餘額度與重置倒數
  • 推播通知 — 任務完成或需要輸入時,透過桌面與行動裝置推播提醒
  • 行動裝置 & 多裝置 — 在手機、平板或其他桌面都能存取同一工作階段
  • 即時工作階段檢視 — 不必捲動 CLI 輸出,進度以時間軸形式整理呈現

此外

  • 不中斷的工作階段 — 以 tmux 為基礎。關閉瀏覽器後工作階段與作業環境依然保留。重新連線時,分頁、窗格、目錄都維持最後狀態
  • 自架 & 開源 — 程式碼與工作階段資料僅存在本機,不經任何外部伺服器
  • 加密遠端存取 — 透過 Tailscale 在任何地方使用 HTTPS 連線

與官方 Remote Control 的差異

官方 Remote Control 專注於單一工作階段的遠端控制。當你需要多工作階段管理、推播通知與工作階段持久化時,請使用 purplemux。

特色

終端機

  • 窗格分割 — 水平 / 垂直自由分割,可拖曳調整大小
  • 分頁管理 — 多分頁、拖曳排序、依據行程名稱自動命名
  • 鍵盤快速鍵 — 分割、切換分頁、移動焦點
  • 終端機佈景主題 — 深色 / 淺色模式,多種配色佈景主題
  • 工作區 & 群組 — 以工作區為單位儲存 / 還原窗格配置、分頁與工作目錄。可透過拖曳將工作區組織為群組進行管理
  • Git 工作流程 — 支援 Side-by-side / Line-by-line 切換與語法高亮,並可行內展開 hunk、分頁瀏覽歷史紀錄分頁。可從窗格直接 fetch / pull / push (含 ahead/behind 指示) — 同步失敗時 (dirty worktree、衝突) 一鍵 Ask Claude
  • 內建瀏覽器窗格 — 在終端機旁嵌入瀏覽器檢視開發結果 (Electron)。可透過 purplemux CLI 控制,並以內建裝置模擬器切換視口

Claude Code 整合

  • 即時狀態 — 執行中 / 等待輸入指示,可於工作階段間切換
  • 即時工作階段檢視 — 訊息、工具呼叫、任務、權限請求、thinking 區塊
  • 一鍵 Resume — 直接從瀏覽器恢復已中斷的工作階段
  • 自動 Resume — 伺服器啟動時自動還原先前的 Claude 工作階段
  • 快速提示 — 註冊常用提示,一鍵送出
  • 附件 — 在聊天輸入中拖放圖片,或附加檔案以自動插入路徑。行動裝置同樣可用
  • 訊息紀錄 — 重複使用先前的訊息
  • 使用量統計 — Token (input / output / cache read / cache write)、成本、依專案分析、每日 AI 報告
  • 速率限制 — 5 小時 / 7 天剩餘額度,重置倒數

行動裝置 & 易用性

  • 響應式 UI — 在手機 / 平板上使用終端機與時間軸
  • PWA — 加入主畫面,體驗接近原生應用
  • Web Push — 關閉分頁仍可接收通知
  • 多裝置同步 — 工作區變更即時同步
  • Tailscale — 透過 WireGuard 加密隧道從外部進行 HTTPS 連線
  • 密碼驗證 — scrypt 雜湊,對外暴露也安全
  • 多語系支援 — 한국어、English、日本語、中文 等 11 種語言

支援的平台

| 平台 | 狀態 | 備註 | |---|---|---| | macOS (Apple Silicon / Intel) | ✅ | 內含 Electron 應用程式 | | Linux | ✅ | 不含 Electron | | Windows | ❌ | 不支援 |

安裝細節

前置需求

npx (最快速)

npx purplemux@latest

全域安裝

npm install -g purplemux
purplemux

從原始碼執行

git clone https://github.com/subicura/purplemux.git
cd purplemux
pnpm install
pnpm start

開發模式:

pnpm dev

記錄層級設定

整體層級以 LOG_LEVEL (預設 info) 調整。

LOG_LEVEL=debug pnpm dev

若只想開啟特定模組,將 模組=層級 組合以逗號分隔寫入 LOG_LEVELS。可用層級: trace / debug / info / warn / error / fatal

# 只以 debug 追蹤 Claude Code hook 行為
LOG_LEVELS=hooks=debug pnpm dev

# 同時指定多個模組
LOG_LEVELS=hooks=debug,status=warn pnpm dev

未在 LOG_LEVELS 中指定的模組,會沿用 LOG_LEVEL

外部連線 (Tailscale Serve)

tailscale serve --bg 8022

透過 https://<machine>.<tailnet>.ts.net 連線。停用:

tailscale serve --bg off 8022

安全性

密碼

首次連線時設定密碼。使用 scrypt 雜湊後儲存於 ~/.purplemux/config.json

如需重置,請刪除 ~/.purplemux/config.json 並重新啟動,引導畫面會再次出現。

HTTPS

預設使用 HTTP。對外暴露時請務必套用 HTTPS:

  • Tailscale Serve — WireGuard 加密 + 自動憑證
  • Nginx / Caddy — 必須轉送 WebSocket 升級標頭 (Upgrade, Connection)

資料目錄 (~/.purplemux/)

| 檔案 | 說明 | |---|---| | config.json | 驗證資訊 (雜湊) 與應用設定 | | workspaces.json | 工作區配置、分頁、目錄 | | vapid-keys.json | Web Push VAPID 金鑰 (自動產生) | | push-subscriptions.json | 推播訂閱資訊 | | hooks/ | 使用者自訂 hook |

架構

┌─────────────────────────────────────────────────────────────┐
│  Browser                                                    │
│  ┌───────────┐ ┌───────────┐ ┌──────────┐ ┌─────────────┐   │
│  │  xterm.js │ │ Timeline  │ │ Status   │ │ Multi-device│   │
│  │  Terminal │ │           │ │          │ │ Sync        │   │
│  └─────┬─────┘ └─────┬─────┘ └────┬─────┘ └──────┬──────┘   │
└────────┼─────────────┼────────────┼──────────────┼──────────┘
         │ws           │ws          │ws            │ws
         │/terminal    │/timeline   │/status       │/sync
         ▼             ▼            ▼              ▼
┌─────────────────────────────────────────────────────────────┐
│  Node.js Server (:8022)                                     │
│  ┌──────────┐  ┌───────────────┐  ┌─────────────────────┐   │
│  │ node-pty │  │ JSONL Watcher │  │ Status Manager      │   │
│  │ PTY↔WS   │  │ File watch →  │  │ Process tree +      │   │
│  │ Binary   │  │ Parse → Send  │  │ JSONL tail analysis │   │
│  └────┬─────┘  └───────┬───────┘  └──────────┬──────────┘   │
└───────┼────────────────┼─────────────────────┼──────────────┘
        ▼                ▼                     ▼
┌─────────────────────────────────────────────────────────────┐
│  System                                                     │
│  tmux (purple socket)         Claude Code                   │
│  ┌────────┐ ┌────────┐       ┌────────────────────────────┐ │
│  │Session1│ │Session2│  ...  │ ~/.claude/sessions/        │ │
│  │ (shell)│ │ (shell)│       │ ~/.claude/projects/        │ │
│  └────────┘ └────────┘       │   └─ {project}/{sid}.jsonl │ │
│                              └────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘

終端機 I/O — xterm.js 透過 WebSocket 連線至 node-pty,node-pty 再接上 tmux 工作階段。使用二進位協定處理 stdin / stdout / resize 並控制背壓。

狀態偵測 — Claude Code 事件 hook (SessionStartStopNotification) 透過 HTTP POST 立即推送更新。每 5–15 秒輪詢一次行程樹,並分析 JSONL 檔案末尾 8KB。

時間軸 — 監聽 ~/.claude/projects/ 下的 JSONL 工作階段記錄,檔案變動時解析新行並將結構化項目串流至瀏覽器。

tmux 隔離 — 使用專屬的 purple socket,與現有 tmux 完全隔離。無前置鍵,無狀態列。

自動還原 — 伺服器啟動時以 claude --resume {sessionId} 還原先前的 Claude 工作階段。

License

MIT