cskwork/claude-code-mods/tree/main/token-weather
token-weather
프롬프트 위에 한 줄짜리 context window 예보를 그려 사용한 token, 12턴 스파크라인, 직전 턴의 token 증분을 보여 주는 mod입니다.
이 mod 소개
token-weather
token-weather는 Claude Code 플러그인(2.1.287+)으로, 프롬프트 바로 위에 context window의 실시간 한 줄 예보를 추가합니다. 상태 표시기(☀ Clear → ↯ Compact soon), 사용한 token, 최근 12턴을 덮는 스파크라인, 가장 최근 턴이 추가한 token 수를 표시합니다. cskwork/claude-code-mods marketplace의 일부이며 다음과 같이 설치합니다:
/plugin marketplace add cskwork/claude-code-mods
/plugin install token-weather@claude-code-mods
/reload-plugins
repository에는 mod 구조(manifest, hooks.json, register.tsx, 선택적 types contract, tests)도 문서화되어 있고 새 mod를 뼈대부터 만드는 도구가 포함되어 있습니다.
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add cskwork/claude-code-mods claude plugin install token-weather
원문 / README
claude-code-mods
Mods for Claude Code (2.1.287+): plugins of function hooks that observe, rewrite or answer what Claude Code does and draw their own UI. Based on Getting started with Claude Code mods.
Landing page: https://cskwork.github.io/claude-code-mods/
| Mod | What it does |
| --- | --- |
| token-weather | A one-line forecast of the context window above the prompt: ☀ Clear → ↯ Compact soon, tokens used, a sparkline of the last 12 turns, and how much the last turn added. |
| blast-radius | Before a risky Bash command runs (recursive rm, git reset --hard, git clean -f, force push, git branch -D, git stash drop/clear, kubectl delete, SQL DROP/TRUNCATE, migrations), dry-runs what it would touch and asks Proceed or Cancel. Cancel or dismiss denies the call. |
| template | Starter mod, not installed: a slash command, a status line entry, a band, and a $.state contract with a test. |
Install
Inside Claude Code:
/plugin marketplace add cskwork/claude-code-mods
/plugin install token-weather@claude-code-mods
/plugin install blast-radius@claude-code-mods
/reload-plugins
Make a new mod
scripts/new-mod.sh my-mod "One line about what it does"
claude --plugin-dir "$PWD/my-mod" # hot-reloads on every save
The script copies template/, renames it, adds it to .claude-plugin/marketplace.json,
then runs claude plugin validate and claude plugin test on it.
A mod is three files plus an optional state contract:
my-mod/
├── .claude-plugin/plugin.json name, version, description, "types"
├── hooks/hooks.json { "modules": ["./register.tsx"] }
├── hooks/register.tsx export const register: Register = on => { ... }
├── types/index.d.ts PluginState contract for $.state values
└── tests/my-mod.test.ts claude plugin test my-mod
Rules that bite:
- Every hook is
($, e, next). Callnext(e)to pass on,next({ ...e, x })to rewrite, return without it to answer. - Keep values in
$.state(atom/read/update); module variables reset on every hot reload. - No Node, no DOM: files, processes, clock and UI go through
$. UI elements come from$.ui.resolve(e). - Test mocks are hooks too:
on('process.run', ($, e) => ({ value: ... })). - After the engine loads a mod it writes
.claude-plugin/types/beside it, sotsc -p <mod>type-checks it (gitignored).
Check
for m in token-weather blast-radius template; do claude plugin validate $m && claude plugin test $m; done
동명의 다른 작품
- token-weatherhamzafer · ★ 91
