jl-cmd-projects/claude-dev-env/tree/main/packages/usage-wrapup
usage-wrapup
一個 Claude Code mod。當方案用量快耗盡時,它會讓每個執行中的 agent 收尾,避免你在任務做到一半、檔案改了一半且沒有交接時被截斷。
關於這個 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:
- start no new work,
- finish or safely pause the current step,
- write a short handoff (done / left / next step),
- arm one wake for just after the reset time, such as
send_laterto its own session or acreate_triggerroutine, so the paused work resumes without a person, - stop and answer.
- Shows
⚠ N% left — wrapping upin 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.

