ClaudeMods
☰
KO
● 0 명 접속 중 · 조회 0 회
후원프로젝트 제출
GitHub 저장소 · 작성자 ShriD5

chai-meter

세션 비용을 상태 표시줄에 표시하는 Claude Code 플러그인(달러 및 차이 컵 단위)으로, 토큰 종류 및 턴별로 비용을 분류하고 세션 및 전체 시간 합계를 추적하는 /chai 명령이 있습니다.

번역 완료

이 mod 소개

chai-meter는 Claude Code 플러그인으로, 상태 표시줄을 세션 비용에 대한 택시 미터로 변환하여 달러와 차이 컵 단위로 표시합니다. 요청이 나가고 응답이 스트리밍될 때 미터는 실시간으로 업데이트되며, 응답이 끝나면 실제 사용량에 따라 확정되어 Claude Code 자체의 비용 장부와 일치합니다. /chai 명령은 모델별로 가격이 책정된 입력, 출력, 캐시 쓰기 및 캐시 읽기 토큰, 가장 비싼 턴, 세션 및 전체 시간 합계를 포함한 세부 정보를 출력합니다. 세션 합계는 다시 로드할 때 $.state에 유지되며, 전체 시간 합계는 세션 간에 $.store에 유지됩니다.

설치는 claude --plugin-dir ./chai-meter 또는 리포지토리를 마켓플레이스로 추가하고 /plugin로 설치하여 수행됩니다. 옵션에는 chaiPriceInr(컵당 루피, 기본값 20), usdToInr(기본값 84), 모델별 가격 책정을 위한 priceOverrides가 포함됩니다. 내장 가격은 hooks/prices.ts에 있으며 Anthropic API 목록 가격입니다. 행이 없는 모델은 /chai에 명시된 대로 Opus 5.5 요율로 가격이 책정됩니다.

기계적으로, 스트리밍 turn.step 훅은 도착하는 응답(이전 요청의 입력 비용과 출력 토큰당 약 4자)을 추정하고, 테이블에서 가격이 책정된 응답의 실제 사용량을 추가합니다. 각 session.measure는 Claude Code 자체의 cost.usd를 기준으로 설정하고, turn.start 및 turn.complete는 턴당 비용을 할당하여 /chai가 가장 비싼 턴을 식별할 수 있도록 합니다.

설치

먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.

claude plugin marketplace add ShriD5/claude-mods
claude plugin install chai-meter
원문 / README

chai-meter

A taxi meter for your Claude Code session, in the status line:

☕ $0.42 · ≈ 1.8 chai

The meter jumps when a request goes out and ticks up while the response streams. When the response ends, it settles on the real usage. After each turn it lines up with Claude Code's own cost ledger.

/chai prints the breakdown:

☕ This session: $0.74 ≈ 3.1 chai (₹62 at ₹20 a cup, $1 = ₹84)
  input              1,500 tokens     $0.01
  output            32,000 tokens     $0.64
  cache write       10,000 tokens     $0.05
  cache read       200,000 tokens     $0.04
  Priced with the table in hooks/prices.ts.
Priciest turn: $0.64, "now rewrite the whole billing module in Rust ple…"
All time: $10.74 ≈ 45 chai

The session total is kept in $.state, so a reload doesn't reset it. The all-time total is kept in $.store and carries across sessions.

Install

claude --plugin-dir ./chai-meter

or add this repo as a marketplace and install it with /plugin.

Options

| Option | Default | What it does | | --- | --- | --- | | chaiPriceInr | 20 | Rupees per cup of chai. | | usdToInr | 84 | Rupees per US dollar. | | priceOverrides | "" | JSON of model id to [input, output, cache write, cache read] dollars per million tokens, e.g. {"claude-opus-5-5": [4, 20, 5, 0.2]}. Rows you leave out keep the built-in prices. |

The built-in prices live in hooks/prices.ts, one row per model. They are Anthropic API list prices as of 2026-09-25, so update them when prices change. Wherever Claude Code keeps a cost ledger, the session total comes from that ledger. The table only prices the live tick and the per-kind and per-turn rows. A model with no row is priced at Opus 5.5 rates, and /chai says so.

How it works

A streaming turn.step hook estimates the response as it arrives: the previous request's input cost, plus about four characters per output token. It then adds the response's real usage, priced from the table. Each session.measure sets the base to Claude Code's own cost.usd. turn.start and turn.complete attribute cost to each turn so /chai can name the priciest one.

비슷한 프로젝트