ClaudeMods
☰
JA
● 0 人がオンライン ・閲覧 0 回
スポンサー作品を投稿
Reddit の投稿 · 投稿者 drkokorev

Context Diet: 巨大なツール出力がコンテキストを溢れさせるのを防ぐ Claude Code モッド

Context Diet は、Claude が読み取る前に大きなツール出力(テスト実行、ビルド、差分、ログ)をトリミングし、失敗、要約、関連する構造のみを保持し、完全な出力を後で取得できるようにファイルに保存します。

翻訳済み

この mod について

1回のテスト実行やビルドログで、Claude のコンテキストに 30~50k 文字がダンプされることがありますが、そのほとんどはノイズです。数千行の PASSED、非推奨警告、ロックファイルの差分などです。コンテキストが埋まり、圧縮が早まり、Claude は最初にあなたが言ったことを忘れてしまいます。

Context Diet は、Claude が読み取る前にすべての大きな出力をトリミングします:

  • テストとビルド(pytest、jest、go test、cargo、tsc…)→ 失敗と要約のみ
  • JSON → その構造
  • 差分 → ロックファイルの変動なし
  • ログ → コンテキスト付きのエラー

完全な出力は常にファイルに保存されるため、Claude はもっと必要になったときにそれを読むことができます。ボーナス:テスト実行が失敗すると、Claude Code は出力の末尾を切り捨てますが、そこがまさに失敗のある場所です。Context Diet はそれらを返します。

18回のエージェント実行でテスト済み:同じバグが修正され、ツール呼び出しは8回ではなく6回。

インストール:

/plugin marketplace add drkokorev/context-diet /plugin install context-diet@context-diet

https://github.com/drkokorev/context-diet

インストール

インストール方法は元のソースをご確認ください。

原文 / README

A single test run or build log can dump 30–50k characters into Claude’s context, almost all of it noise: thousands of PASSED lines, deprecation warnings, lockfile diffs. The context fills up, compaction comes sooner, and Claude forgets what you said at the start. Context Diet trims every big output before Claude reads it: tests and builds (pytest, jest, go test, cargo, tsc…) → only the failures and the summary JSON → its structure, diffs → without lockfile churn, logs → errors with context the full output is always saved to a file, so Claude can read it when it needs more Bonus: when a test run fails, Claude Code cuts the end of the output, exactly where the failures are. Context Diet gives them back. Tested on 18 agent runs: same bugs fixed, 6 tool calls instead of 8. /plugin marketplace add drkokorev/context-diet /plugin install context-diet@context-diet https://github.com/drkokorev/context-diet submitted by /u/drkokorev to r/ClaudeCodeMods [link] [comments]

同名の他の作品

関連作品