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

context-alarm

一個 Claude Code mod,在內容視窗填滿時發出警告,並建議在自動壓縮抹去工作階段決定前用 /save-context 儲存它們。

mutlumehmet@mutlumehmet

mutlumehmet/claude-plugins/tree/main/plugins/context-alarm

原貼文圖片1
已翻譯

關於這個 mod

context-alarm

一個 Claude Code mod,在內容視窗快滿時發出警告,並建議在自動 compaction 將工作階段決定總結掉之前,用 /save-context 儲存它們。它屬於 claude-plugins。

What it does

  • 達到 80%(warn_percent 設定,範圍 50 到 95):顯示通知、提示列下方的狀態列(Context 83% · /save-context suggested),並在空白提示框中建議 /save-context。
  • 再高 10 個百分點:再顯示一次自動 compaction 即將發生的通知。
  • 自動 compaction 前若尚未儲存:顯示最後一次通知,但 compaction 仍會執行。
  • /save-context 執行後:停止建議,狀態列也會說明這一點。
  • /context-alarm:顯示內容視窗填充量和門檻。

它會從同一 marketplace 安裝提供 /save-context 的 project-workflow 作為相依專案。

What it reads and does

  • Reads:內容視窗有多滿、/save-context 是否執行,以及自動 compaction 何時開始。
  • Does:通知、提示列下方的狀態列,以及空白提示框中的 /save-context 建議。不會自行執行 save-context。
  • Hooks:skill.prompt 只記錄 save-context 已執行,並原樣傳遞 skill 提示;session.compact 只發警告,壓縮仍會執行;command.run 只回應自己的 /context-alarm 指令。
  • Privacy:見 PRIVACY.md。
  • Never:不向任何地方傳送內容,不進行網路呼叫或遙測。

Install

需要 Claude Code 2.1.287 或更新版本(mods),已在 2.1.289 測試。

/plugin marketplace add mutlumehmet/claude-plugins
/plugin install context-alarm@mehmetmutlu

mod 會在 Claude Code 權限下執行。安裝前先讀程式碼。

Known gaps

  • 跨過門檻的那個回合可能錯過提示列建議(新的百分比在回合結束後才到達),但通知和狀態列仍會顯示。
  • 如果一個回合同時越過兩個門檻,只顯示第二個通知。
  • VS Code chat panel 中不會繪製內容。

About

Mehmet Mutlu: work that's shipped, at mehmetmutlu.dev

Made by Mehmet Mutlu,屬於 claude-plugins。更多作品見 mehmetmutlu.dev。

License

MIT

安裝

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

claude plugin marketplace add mutlumehmet/claude-plugins
claude plugin install context-alarm
原文 / README

context-alarm

A Claude Code mod that warns when the context window fills up and suggests saving the session's decisions with /save-context before automatic compaction summarises them away. Part of claude-plugins.

What it does

  • At 80% (the warn_percent setting, 50 to 95): a notice, a status line under the prompt (Context 83% · /save-context suggested) and /save-context suggested in the empty prompt box.
  • 10 points higher: one more notice that automatic compaction is close.
  • Before an automatic compaction without a save: a last notice. The compaction still runs.
  • After /save-context runs: the suggestions stop and the status line says so.
  • /context-alarm: shows how full the context is and the thresholds.

It installs project-workflow from the same marketplace as a dependency, which provides /save-context.

What it reads and does

  • Reads: how full the context window is, whether /save-context ran, and when an automatic compaction starts.
  • Does: notices, a status line under the prompt, and /save-context suggested in the empty prompt box. It never runs save-context itself.
  • Hooks: skill.prompt (save-context only) notes that it ran and passes the skill's prompt on unchanged. session.compact only warns; the compaction still runs. command.run answers its own /context-alarm command and no other.
  • Privacy: see PRIVACY.md.
  • Never: sends anything anywhere (no network calls, no telemetry).

Install

Needs Claude Code 2.1.287 or later (mods). Tested on 2.1.289.

/plugin marketplace add mutlumehmet/claude-plugins
/plugin install context-alarm@mehmetmutlu

A mod runs inside Claude Code with your permissions. Read the code before you install any mod.

Known gaps

  • On the turn that crosses the threshold the prompt suggestion can be missed (the new percent arrives after the turn ends); the notice and status line still show.
  • If one turn jumps past both thresholds, only the second notice shows.
  • Nothing is drawn in the VS Code chat panel.

About

Mehmet Mutlu: work that's shipped, at mehmetmutlu.dev

Made by Mehmet Mutlu, part of claude-plugins. More of his work at mehmetmutlu.dev.

License

MIT

更多類似作品