ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 jamubc

redline

Claude 工作階段的轉速表:指針碰到紅線時,停止啟動新的工作階段,開始完成手上的工作。

已翻譯

關於這個 mod

redline

同時跑太多 Claude?覺得應接不暇?redline 會在 Claude Code 提示列上方放一個儀表,計算有多少工作階段正在執行,讓你更好安排時間。

<img width="638" height="98" alt="image" src="https://github.com/user-attachments/assets/c7d1ae26-46c2-4222-be22-d6f85e3db13f" /> <img width="302" height="731" alt="image" src="https://github.com/user-attachments/assets/4e546a80-f59e-4ba1-a81e-f5f83e7b584f" />

停止啟動新的 Claude,先完成已經在執行的工作階段。

安裝

加入市集:

/plugin marketplace add jamubc/toolbox

安裝外掛:

/plugin install redline@toolbox

使用方式

| 指令 | 功能 | | --- | --- | | UI Mod | 儀表與標籤。 | | /redline | 切換詳細檢視。 | | /redline <0-25> | 示範:啟用。 | | /redline live | 示範:停用 | | /config → Show the count at the bottom of the terminal | 切換標籤 | | /config → Show the fuel gauges | 切換 5H / 7D / CTX 錶面 |

燃料錶面

<details> <summary>三個錶面,切換開啟前都是關閉狀態</summary> <br>

開啟 Show the fuel gauges 後,會多出三個錶面:一個在提示列上方的轉速表旁,另外兩個在面板裡轉速表下方。

| 錶面 | 讀取內容 | | --- | --- | | 5H | 方案的五小時速率限制視窗。 | | 7D | 方案的七天速率限制視窗。 | | CTX | 這個工作階段的內容,會隨著對話變長而填滿。 |

每個錶面的指針都會向右擺,油箱用得越多就越接近紅線。方案視窗會消耗,所以 5H 和 7D 會從 F(滿)讀到 E(空);內容會填滿,所以 CTX 會從 E 讀到 F。方案錶面需要訂閱;CTX 所有人都能使用。引擎沒有讀數的錶面會保持暗色。

</details>

階段

<details> <summary>依執行中工作階段數量劃分的階段</summary> <br>

| 執行中 | 階段 | | --- | --- | | 0 | 打盹 | | 1–2 | 怠速 | | 3–5 | 巡航 | | 6–8 | 忙碌 | | 9–12 | 非常忙碌 | | 13–17 | 承受壓力 | | 18–20 | 紅線 | | 21–24 | 過度增壓 | | 25+ | 爆缸 |

</details>

它會執行、讀取和傳送什麼

redline 會在你的電腦上執行兩個唯讀程式,不會將任何內容傳到別處。它不會發出網路請求。

| 程式 | 確切執行內容 | 用途 | | --- | --- | --- | | ps | ps -x -o pid=,ppid=,tty=,args=,每兩秒一次 | 列出你自己的程序,找出終端機中的 claude 工作階段,以及哪些正在執行回合。 | | ps | ps -x -o pid=,ppid=,tty=,command=,每個工作階段一次,直到成功 | 用另一種格式讀取同一份表格,讓 redline 判斷哪個是目前工作階段,並在面板標示為 (this one)。 | | lsof | lsof -a -d cwd -Fn -p <pids>,每兩秒一次,其中 <pids> 是 ps 剛找出的 claude 工作階段 | 讀取每個工作階段的工作目錄,顯示在面板旁。 |

  • 工作階段是連接到終端機的 claude 程序。當 Claude Code 持有 caffeinate 子程序時,工作階段會算作正在執行;這會在 macOS 的一個回合期間發生。在 Linux 上,每個工作階段都會顯示為閒置。
  • 開啟燃料錶面後,它會讀取這個工作階段的用量(session.usage,以及每個回合結束後的 session.measure 事件):包括內容填入量與方案的速率限制百分比,也就是狀態列顯示的相同數字。這些數值會畫在錶面上,並保存在這個工作階段的外掛狀態中;redline 不會將它們寫入磁碟,也不會傳到別處。
  • 它不會啟動、停止或變更其他程序。程序表只會被讀取、在記憶體中解析後丟棄。
  • 它只會為自己的 /redline 指令掛接 command.run,用來開關面板和設定示範計數。它看不到也不會變更任何其他指令。
  • 它會掛接 ui.close,在你關閉面板時得知;也會掛接 session.start、session.end 和 session.measure,讓儀表在 /clear 前後都保持正確。

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add jamubc/toolbox
claude plugin install redline
原文 / README

redline

Too many Claudes going at once? Feeling overwhelmed? redline puts a gauge above your Claude Code prompt that counts how many of your sessions are working, so you can plan your time better.

<img width="638" height="98" alt="image" src="https://github.com/user-attachments/assets/c7d1ae26-46c2-4222-be22-d6f85e3db13f" /> <img width="302" height="731" alt="image" src="https://github.com/user-attachments/assets/4e546a80-f59e-4ba1-a81e-f5f83e7b584f" />

stop starting new Claudes and finish the ones already running.

Install

Add the marketplace:

/plugin marketplace add jamubc/toolbox

Install the plugin:

/plugin install redline@toolbox

Usage

| Command | What it does | | --- | --- | | UI Mod | gauge & labels. | | /redline | Toggles detailed view. | | /redline <0-25> | demo: enable. | | /redline live | demo: disable | | /config → Show the count at the bottom of the terminal | toggle labels | | /config → Show the fuel gauges | toggle the 5H / 7D / CTX dials |

Fuel gauges

<details> <summary>The three dials, off until switched on</summary> <br>

With Show the fuel gauges on, three more dials ride along: beside the tachometer above your prompt, and under it in the pane.

| Dial | What it reads | | --- | --- | | 5H | Your plan's five-hour rate-limit window. | | 7D | Your plan's seven-day rate-limit window. | | CTX | This session's context, filling as the conversation grows. |

On every dial the needle swings right, into the red, as its tank is used. The plan windows drain, so 5H and 7D read F (full) to E (empty); the context fills, so CTX reads E to F. The plan dials need a subscription; CTX works for everyone. A dial the engine has no reading for stays dim.

</details>

Stages

<details> <summary>Stages by sessions working</summary> <br>

| Working | Stage | | --- | --- | | 0 | Napping | | 1–2 | Idling | | 3–5 | Cruising | | 6–8 | Busy | | 9–12 | Very Busy | | 13–17 | Under Pressure | | 18–20 | Redline | | 21–24 | Overboost | | 25+ | Blown |

</details>

What it runs, reads and sends

redline runs two read-only programs on your machine and sends nothing anywhere. It makes no network requests.

| Program | Exactly what it runs | Why | | --- | --- | --- | | ps | ps -x -o pid=,ppid=,tty=,args=, every two seconds | Lists your own processes, to find the claude sessions in your terminals and which are mid-turn. | | ps | ps -x -o pid=,ppid=,tty=,command=, once a session until it succeeds | The same table in a second format, so redline can tell which session is this one and mark it (this one) in the pane. | | lsof | lsof -a -d cwd -Fn -p <pids>, every two seconds, where <pids> are the claude sessions ps just found | Reads each session's working directory, shown beside it in the pane. |

  • A session is a claude process attached to a terminal. It counts as working while Claude Code holds a caffeinate child process, which happens on macOS during a turn. On Linux every session reads as idle.
  • With the fuel gauges on, it reads this session's usage (session.usage, and the session.measure event after each turn): the context fill and your plan's rate-limit percentages, the same figures the status line has. They are drawn on the dials and kept in this session's plugin state; they are never written to disk by redline or sent anywhere.
  • It never starts, stops or changes another process. The process tables are read, parsed in memory and dropped.
  • It hooks command.run only for its own /redline command, which opens and closes the pane and sets the demo count. It does not see or change any other command.
  • It hooks ui.close to notice when you close its pane, and session.start, session.end and session.measure to keep the gauge right across /clear.

更多類似作品