ClaudeMods
☰
ZH-CN
● 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.

更多类似作品