本文へ移動
cccskills
無料GitHub で公開日本語紹介

token-card

ローカルにある複数のAI開発エージェントのログを集計し、トークン数やAPI換算費用をSVGカードにします。READMEや資料に載せる利用状況をまとめられます。

原文原文の説明を見る

Render a token-usage stat card from local Claude Code, Codex, Gemini CLI, and OpenCode session logs and commit it into the repository as a file. Use when someone wants a current usage figure in a README, or asks for a shareable card of their coding-agent activity.

インストール方法を見る

こんなときに便利

  • READMEにエージェント利用状況を掲載
  • 複数エージェントの活動を共有したいとき
  • トークン数とAPI換算費用の可視化
  • 書き込み前にカード出力を確認したいとき

日本語での紹介

できること

ローカルのAI開発エージェントの利用ログから、READMEや資料に載せられるSVGカードを作成します。Claude Code、Codex、Gemini CLI、OpenCodeを対象に、総トークン数、API換算費用、連続利用日数、エージェント別の内訳をまとめます。カードはリポジトリ内のファイルとして参照でき、外部の画像配信先に依存しません。

こんなときに便利

複数ツールでの活動を一枚にまとめて共有したいときや、開発プロジェクトのREADMEに利用状況を表示したいときに向いています。出力先や明るい・暗いテーマを指定でき、--dry-runではファイルを変更せずに出力予定を確認できます。

使い方の例

  • 「このマシンのエージェント利用状況をSVGカードにして」
  • 「ダークテーマでカードを作り、保存先を指定して」
  • 「ファイルを書き込まずに生成内容を確認して」

注意点

Node.js 22以上と、MITライセンスの@tokenchit/cli@0.10.0を使います。初回のダウンロードと実行には確認が必要です。集計はトークン数と日時を読み、ログの内容をサーバーへ送信しません。費用はAPI換算値です。READMEの編集や公開ランキングへの掲載は、別途依頼がある場合に行います。

この紹介文は、公開されている SKILL.md をもとに AI(Claude Haiku)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(1)

  • SKILL.md5.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Token Card

Produce an SVG card summarising this machine's AI coding agent usage — total tokens, equivalent API cost, current streak, and the split across agents — and write it into the working tree as a file the README can reference.

The card is a committed artifact rather than a hosted image, so it renders from the repository itself and does not depend on a third-party endpoint staying up.

When to Activate

  • Someone wants a usage figure visible in a README or docs page.
  • Someone asks for a shareable summary of their agent activity across tools.

Use /cost-report instead when the question is "what did I spend this week". The two read different sources and produce different things:

/cost-reportToken Card
Source~/.claude/metrics/costs.jsonl, written by ECC's stop:cost-tracker hookThe agents' own session logs
AgentsClaude CodeClaude Code, Codex, Gemini CLI, OpenCode
OutputTerminal summary, optional CSVAn SVG file committed to the repo

The tool this runs

@tokenchit/cli, MIT licensed: https://github.com/iyashjayesh/tokenchit

Pinned to an exact version, deliberately. @latest resolves to whatever the registry currently serves, and this tool reads local session logs — so a compromised future release would be executed with access to them before anyone had reviewed it. Pin, and raise the pin knowingly:

TOKENCHIT_VERSION=0.10.0

To check the pinned artifact before running it the first time:

npm view @tokenchit/cli@0.10.0 dist.integrity dist.tarball

Workflow

  1. Ask before the first download. npx fetches the package from the npm registry and executes it. That is a remote download of code that will read local logs, so get explicit confirmation from the user before the first run on a machine. If they decline, stop here and say what would have run.

  2. Configure, unless this is a dry run. If .tokenchit.json is absent, run:

    npx -y @tokenchit/cli@0.10.0 init
    

    It detects which agents have logs on this machine and records them. The file is meant to be committed and never contains a credential.

    Skip this entirely when the user passed --dry-run, and report that .tokenchit.json would be created. A preview that writes a config file is not a preview.

  3. Render the card. The bare command writes to the configured output — tokenchit.svg unless .tokenchit.json names another path:

    npx -y @tokenchit/cli@0.10.0 sync
    

    Append only the flags the user actually asked for, each spelled exactly as below. Do not copy a placeholder into the command — sync ignores an unrecognised positional argument rather than refusing it, so a bracketed [--dry-run] reaches the CLI as junk and the card is written anyway, which is the opposite of what was asked.

    FlagEffect
    --out <path>Write somewhere other than the configured output
    --theme auto | light | darkCard theme; auto adapts to the reader's system
    --dry-runPrint what would be written and touch nothing

    sync reads local files and sends nothing: no prompts, no code, no file contents leave the machine, and it transmits nothing to any server. The npx invocation around it is a registry download — that is the network access in this workflow, and step 1 is where it is agreed.

  4. Report and offer. Print the figures it produced — tokens, equivalent cost, streak, per-agent split — and the path written. If the repository has a README that does not yet reference the card, offer to add:

    ![tokenchit](./tokenchit.svg)
    

    sync prints the path relative to the repository root. A Markdown image resolves relative to the file it sits in, so rewrite it for the README being edited: a card at docs/usage.svg is ./docs/usage.svg from the root README but ../usage.svg from docs/zh-CN/README.md. Pasting the printed path into a nested README points at docs/zh-CN/docs/usage.svg and renders broken.

    Do not edit the README without being asked.

Stop after step 4. Publishing to the public leaderboard is a separate publish command that requires explicit opt-in, and is not part of this workflow — run it only if the user asks for it by name. unpublish removes the row and the account again.

Output

The path of the SVG, the figures it contains, and the markdown snippet for referencing it. On a dry run: what would have been written, and nothing on disk changed.

Notes

  • Requires Node.js 22 or newer (the package declares engines: { node: ">=22" }). Nothing is installed globally; npx fetches the pinned version per run.
  • Reads token counts and timestamps only.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

accessibility

無料日本語概要

Web・iOS・Androidの画面を、読み上げやキーボード操作に対応させ、ラベル、配色、操作対象の大きさなどをWCAG 2.2に沿って設計・点検するスキル。

  • アイコンボタンの説明を付けたいとき
  • キーボード操作とモーダルの点検
  • コントラストや操作対象の大きさの確認
affaan-m/ECC27.8万2026年10月12日 更新

agent-architecture-audit

無料日本語概要

AIエージェントの不調を、指示・記憶・ツール実行・画面表示など12の層から調べるスキル。コードやログを根拠に原因を整理し、重要度順の指摘と修正案をまとめます。

  • アプリ内だけで起きる不調を調べたいとき
  • 過去の会話が混ざる原因を調査
  • ツールの未実行や実行の誤報を確認
affaan-m/ECC27.8万2026年10月12日 更新

agent-eval

無料日本語概要

実際の開発課題で複数のコーディングエージェントを比較するスキル。成功率、取得可能なAPI費用、所要時間、繰り返し実行の安定性を測り、選定や更新後の評価に使えます。

  • 実際の開発課題でエージェントを比較
  • 新しいツールやモデルの導入前評価
  • エージェント更新後の性能確認
affaan-m/ECC27.8万2026年10月12日 更新

agent-harness-construction

無料日本語概要

AIエージェントが使うツールの種類や入出力、エラーからの復帰手順を設計・見直します。文脈の情報量も整理し、作業完了率や再試行回数で改善を評価します。

  • エージェントのツールや入力形式の設計
  • ツールの結果と次の行動を明確にしたいとき
  • 安全な再試行と停止条件を定めたいとき
affaan-m/ECC27.8万2026年10月12日 更新

agent-introspection-debugging

無料日本語概要

AIエージェントの失敗や同じ操作の繰り返しを記録し、原因の切り分け、小さな復旧操作、結果の報告まで進める手順を示して、根拠のある再試行につなげるスキル。

  • 同じツール操作を繰り返す原因の調査
  • 会話の肥大化による品質低下の調査
  • ファイルパスや環境の食い違いの確認
affaan-m/ECC27.8万2026年10月12日 更新

agent-introspection-debugging

無料日本語概要

AIエージェントが失敗や同じ操作を繰り返す原因を、エラーと実行状況から整理します。小さな復旧操作を試し、結果と根拠を引き継げる報告にまとめるスキルです。

  • エージェントの連続失敗を診断したいとき
  • 同じツール操作のループ調査
  • 情報の蓄積による出力劣化の点検
affaan-m/ECC27.8万2026年10月5日 更新

affaan-m のスキルをすべて見る

このスキルの問題を報告する