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

token-weather

一個 Claude Code 外掛,在提示列上方繪製執行階段內容視窗的即時預測,顯示填充百分比、上一輪新增的內容,以及表示視窗由什麼填滿的彩色列。

BrightGold70@BrightGold70

BrightGold70/skills/tree/main/mods/token-weather

已翻譯

關於這個 mod

token-weather 是一個 Claude Code 外掛,會在提示列上方繪製執行階段內容視窗的即時預測。它顯示目前的填充百分比、上一輪增加了多少內容,以及用 /context 的色彩表示視窗填充情況的彩色列。

在 Mac 上安裝:

  1. 將外掛連結到外掛目錄:
mkdir -p ~/.claude/mods
ln -sfn ~/orca/skills/mods/token-weather ~/.claude/mods/token-weather
  1. 將下列內容加入 ~/.claude/settings.json 的 "env" 區塊來註冊:
"CLAUDE_CODE_PLUGIN_DIRS": "/Users/<you>/.claude/mods/token-weather"

多個外掛資料夾會以 ':' 連接。

  1. 驗證並測試,然後重新啟動 Claude Code:
claude plugin validate ~/.claude/mods/token-weather
claude plugin test ~/.claude/mods/token-weather

正在執行的工作階段不會載入新註冊的外掛;外掛表在啟動時固定,因此註冊後要重新啟動。

檔案:.claude-plugin/plugin.json(資訊清單)、hooks/hooks.json → hooks/register.tsx(hooks 模組)、hooks/weather.ts(附測試的純輔助函式)、types/index.d.ts($.state 契約)。

安裝

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

claude plugin marketplace add BrightGold70/skills
claude plugin install token-weather
原文 / README

token-weather

A Claude Code mod: a live forecast of the context window, drawn above the prompt — fill percentage, what the last turn added, and a bar of what fills the window in /context's colours.

Install on a Mac

The mod loads from ~/.claude/mods/token-weather, which is a symlink into this checkout, so a git pull updates it and the settings line is the same on every machine.

# 1. Link the mod (adjust the checkout path if yours differs). If a real
#    ~/.claude/mods/token-weather directory already exists, move it away first:
#    `ln -sfn` onto a directory puts the link INSIDE it instead of replacing it.
mkdir -p ~/.claude/mods
ln -sfn ~/orca/skills/mods/token-weather ~/.claude/mods/token-weather

# 2. Register it: add to the "env" block of ~/.claude/settings.json
#      "CLAUDE_CODE_PLUGIN_DIRS": "/Users/<you>/.claude/mods/token-weather"
#    Several plugin folders are joined with ':'. Use an absolute path or ~.

# 3. Check it, then restart Claude Code
claude plugin validate ~/.claude/mods/token-weather
claude plugin test ~/.claude/mods/token-weather

A running session never picks up a newly registered mod — the plugin table is fixed at launch — so restart after step 2. claude plugin list reports a fresh process, not your session, and can say loaded while the session you are in has not.

Files

  • .claude-plugin/plugin.json — manifest
  • hooks/hooks.json → hooks/register.tsx — the hooks module
  • hooks/weather.ts — pure helpers; hooks/weather.test.ts tests them
  • types/index.d.ts — the $.state contract

.claude-plugin/types/ is written by Claude Code at every load (API typings for tsc -p) and ignores itself; it is never committed.

其他同名作品

更多類似作品