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

コンテキストを実際に何が消費しているかを表示する Claude Code mod を作りました

ある Reddit の作者が cc-side-context をリリースしました。これは Claude Code プラグインで、コンテキストウィンドウを何が消費しているかを分解してサイドペインに表示します。最大の出力、それぞれの占有量、プロンプトキャッシュの有効期限がわかります。また、早期の指示を保持するコンパクト変種と、あるファイルが以前にコンテキストを大幅に増やした場合にそのファイルの読み取りを 1 回だけ弾くガードも追加します。

翻訳済み

この mod について

cc-side-context は MIT ライセンスの Claude Code mod で、/plugin marketplace add bcanozgur/cc-side-context と /plugin install cc-side-context@cc-side-context でインストールします。チャットの横にペイン(さらにプロンプト上方の任意の小さなバー)を表示し、最大のコンテキスト消費元、そのサイズ、プロンプトキャッシュの有効期限を一覧表示します。また、新しい function-hooks mods API と TSX でレンダリングされた UI を通じて、ターミナルとデスクトップアプリの両方で動作します。機能には、早期のユーザー指示を保持する要約を備えたコンパクトモードや、オプトインのガードがあります。このガードは、あるファイルが以前にコンテキストを大幅に増やした場合、そのファイルの読み取りを 1 回スキップし、Claude が再び要求した場合は読み取りを通します。Claude Code 2.1.287+(デスクトップアプリ 2.1.286)が必要です。作者は、ローカルで実行され、正確なトークン数を取得するために /context が使用するのと同じ API 経由でネットワークに接続するだけだと述べています。

インストール

まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。

claude plugin marketplace add bcanozgur/cc-side-context
claude plugin install cc-side-context@cc-side-context
原文 / README

got annoyed that /context only ever says "conversation 320k" and nothing else. dug into a transcript once and like 60k of it was the same package-lock.json getting read 3 times. so yeah

made a mod that sits next to the chat and just shows that. biggest outputs, how much each one takes, when the cache is gonna expire. theres a small bar above the prompt too if you dont want the whole pane. works in the terminal and the desktop app (left/right in the pic)

the thing i actually use most is c, its compact but it makes the summary keep the stuff i told it early on. compact kept dropping that for me. theres also a guard thing (x) that bounces a file read once if that file already blew up your context before. if claude asks again it just goes through so it never really blocks you
needs claude code 2.1.287 or newer, desktop app 2.1.286

/plugin marketplace add bcanozgur/cc-side-context

/plugin install cc-side-context@cc-side-context

built the whole thing in claude code sessions, mostly me describing what i wanted to see and claude writing the hooks + pane. it uses the new mods api (function hooks) so the pane is just tsx that claude code renders, same file draws in the terminal and the desktop app. biggest pain was the desktop side, the layout there is real html boxes not terminal cells so stuff that looked fine in iterm broke at narrow widths, took a bunch of rounds with screenshots back and forth

stuff i learned along the way: 4 chars per token is way off for non english text, turkish/accented stuff is closer to 2 and cjk is ~1, so my first estimates were lying. the 5h/7d usage only shows up with an api response so you cant really show it on startup without caching stale numbers (i chose not to). and the prompt cache is 1h on a sub but drops to 5m once youre on usage credits, which i didnt know

free and MIT, runs locally, doesnt send anything anywhere except when you ask for an exact token count (same api /context uses)

https://github.com/bcanozgur/cc-side-context

lmk if something breaks

バッジを取得

あなたのプロジェクトですか?このバッジを README やサイトに貼ると、このページにリンクします。

Featured on ClaudeMods
サイズ
テーマ
Markdown
HTML

関連作品