ClaudeMods
☰
JA
● 0 人がオンライン ・閲覧 0 回
スポンサー作品を投稿
GitHub リポジトリ · 投稿者 mutlumehmet

context-alarm

コンテキストウィンドウが埋まると警告し、自動 compaction でセッションの決定が要約される前に /save-context で保存するよう促す Claude Code mod です。

mutlumehmet@mutlumehmet

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

元の投稿の画像1
翻訳済み

この mod について

context-alarm

コンテキストウィンドウが埋まると警告し、自動 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 の project-workflow を依存としてインストールし、/save-context を提供します。

What it reads and does

  • Reads:コンテキスト使用量、/save-context の実行有無、自動 compaction の開始時刻。
  • Does:通知、プロンプト下のステータス行、空のボックス内の /save-context 提案。save-context 自体は実行しません。
  • Hooks:skill.prompt は save-context が実行されたことだけを記録し、skill の prompt を変更せず渡します。session.compact は警告だけで、圧縮は続きます。command.run は自分の /context-alarm だけに応答します。
  • Privacy:PRIVACY.md を参照。
  • Never:何も外へ送らず、ネットワーク呼び出しやテレメトリを行いません。

Install

Claude Code 2.1.287 以降が必要で、2.1.289 でテスト済みです。

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

mod は Claude Code の権限で動きます。インストール前にコードを読んでください。

Known gaps

  • しきい値を越えたターンでは、次の割合がターン後に届くため prompt の提案を見逃すことがありますが、通知とステータス行は表示されます。
  • 1 ターンで両方のしきい値を越えると、2 つ目の通知だけが表示されます。
  • 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

関連作品