ctx
Skill0 starsChanged 52 days agoMITView on GitHub
今のセッションのコンテキスト使用率(ctx)と利用上限の使用率(5h / 7d)を同梱スクリプトで調べて返す。Discord からの依頼なら reply で返し、ターミナルから呼ばれたらその場で答える
4 other projects use a version of this.
Adopted by
Most recently taken up by
- motiful/ctxtheir own version, first seen Oct 11, 2026
- ctxrs/ctxtheir own version, first seen Aug 17, 2026
- puretensor/agent-context-bundlestheir own version, first seen Jun 17, 2026
- ctx-hq/ctxtheir own version, first seen Mar 30, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- ctxrs/ctx★ 1.2ksame name
- motiful/ctx★ 1same name
- puretensor/agent-context-bundles★ 1same name
- ctx-hq/ctx★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Files
コンテキスト使用量の確認
Discord セッションは 1 つのセッションを開いたまま使うので、コンテキストの残りを Discord から確かめられるようにする。値はターミナル下部のステータスラインと同じ。
手順
次を実行する。引数は要らない(セッション ID は環境変数
CLAUDE_CODE_SESSION_IDから取る)${CLAUDE_SKILL_DIR}/scripts/context_usage.py- Discord からの依頼なら、出力をそのままコードブロックに入れて reply する。前置きは付けない。コードブロックに入れるのは、Discord が行頭の記号をリスト表示に変えて崩すため
ctxが 80% 以上なら、「区切りのいいところで /clear しようか」と一言添える- ターミナルから呼ばれたときは reply せず、出力をそのまま答える
数値の意味
ctx: コンテキストウィンドウの使用率。直前の API 応答の時点の入力トークン(キャッシュを含む)をウィンドウ幅で割ったもの5h/7d: 利用上限の使用率と、リセットの時刻(JST)source statusline: ステータスラインが保存した JSON から読んだ値。ターミナルの表示と同じsource transcript: ステータスラインの JSON が無いときの代わり。会話ログの usage から概算し、ウィンドウ幅は settings.json の model から推定する([1m]なら 1M)。5h / 7d は出ない
失敗したとき
「使用量データが見つかりません」と出たら、まだ API の応答が 1 回も無い新しいセッションか、ステータスラインの JSON を保存する設定が無い環境。1 ターン進めてから実行し直すか、README のセットアップ(ステータスラインの JSON を保存する手順)を確かめるよう伝える。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

