ClaudeMods
☰
ZH-CN
● 0 人在线 · 浏览 0 次
赞助提交作品
GitHub 仓库 · 发布者 jl-cmd-projects

usage-wrapup

一个 Claude Code mod。当计划用量快耗尽时,它会让每个正在运行的 agent 收尾,避免你在任务做到一半、文件改了一半且没有交接时被截断。

jl-cmd-projects@jl-cmd-projects

jl-cmd-projects/claude-dev-env/tree/main/packages/usage-wrapup

已翻译

关于这个 mod

一个 Claude Code mod,监视 Pro/Max/Team 的速率限制窗口(5 小时、每周、花费上限)。当某个窗口只剩 1% 或更少(可配置)时,主 agent 和 subagent 的每个工具结果都会带上提示:不要开始新工作,完成当前步骤或安全暂停,写一份简短交接(已完成 / 留下的内容 / 下一步),通过 send_later 或 create_trigger 例程安排一次刚好在重置时间之后唤醒的任务,然后停止并作答。它也会显示状态行警告和一次性 toast;当 5 小时窗口达到 97% 已用,或每周窗口达到 99% 已用时,在回合结束时压缩对话,每个窗口一次,跳过中断的回合和 subagent 回合,并保留当前任务、状态、触碰过的文件和下一步的摘要。只适用于 Claude 订阅。通过克隆仓库并使用 --plugin-dir 启动来安装;通过 /config thresholds 配置阈值。

安装

请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。

claude plugin marketplace add jl-cmd-projects/claude-dev-env
claude plugin install usage-wrapup
原文 / README

usage-wrapup

A Claude Code mod. When your plan usage gets low, it tells every running agent to wrap up — so you don't get cut off mid-task with half-edited files and no handoff.

What it does

  • Watches your rate-limit windows (5-hour, weekly, spend limit).
  • When any window has 1% or less left (configurable), every tool result — in the main agent and in subagents — carries a note telling the model to:
    1. start no new work,
    2. finish or safely pause the current step,
    3. write a short handoff (done / left / next step),
    4. arm one wake for just after the reset time, such as send_later to its own session or a create_trigger routine, so the paused work resumes without a person,
    5. stop and answer.
  • Shows ⚠ N% left — wrapping up in the status line and a one-time toast.
  • Compacts the conversation when usage is nearly gone. This happens when the 5-hour window is 97% used or more, or the weekly window is 99% used or more.
    • It compacts when a turn ends, so the next turn starts with a smaller context.
    • It compacts once per window. When the window resets, it can compact again.
    • The summary keeps the current task, its state, the files it touched, and the next steps.
    • It skips a turn you interrupted, and it skips subagent turns.

Only works on a Claude subscription (Pro/Max/Team), where Claude Code gets rate-limit data.

Install

git clone https://github.com/DaKev/usage-wrapup ~/claude-mods/usage-wrapup
claude --plugin-dir ~/claude-mods/usage-wrapup

Configure

/config has three options:

  • Wrap-up threshold (% left). Default 1.
  • Compact at 5-hour usage (% used). Default 97.
  • Compact at weekly usage (% used). Default 99.

Test

claude plugin validate .
claude plugin test .

MIT license. See LICENSE.

更多类似作品