token-card
Skill này làm gì
Tạo một thẻ hình ảnh (SVG) cho thấy bạn đã dùng công cụ AI cho lập trình bao nhiêu, chi phí tương đương và tiến độ gần đây của bạn. Thẻ này được lưu trực tiếp vào các file code của bạn.
Khi nào nên dùng
- ✓Khi bạn muốn hiển thị mức dùng AI trong việc lập trình ngay trong dự án.
- ✓Khi bạn muốn có bản tóm tắt dễ chia sẻ về hoạt động lập trình có AI.
- ✓Khi bạn muốn xem tóm tắt sử dụng AI mà không cần dựa vào dịch vụ trực tuyến.
Liên kết skill
https://github.com/affaan-m/ECC/blob/main/skills/token-card/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Hãy tạo thẻ thống kê token cho dự án của tôi.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ kiểm tra nhật ký sử dụng của các chương trình AI (như Claude Code, Gemini, v.v.) trên máy tính của bạn. Sau đó, nó tạo một hình ảnh (SVG) với các thông tin này và lưu vào một thư mục trong dự án.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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-report |
Token Card | |
|---|---|---|
| Source | ~/.claude/metrics/costs.jsonl, written by ECC's stop:cost-tracker hook |
The agents' own session logs |
| Agents | Claude Code | Claude Code, Codex, Gemini CLI, OpenCode |
| Output | Terminal summary, optional CSV | An 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
Ask before the first download.
npxfetches 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.Configure, unless this is a dry run. If
.tokenchit.jsonis absent, run:npx -y @tokenchit/cli@0.10.0 initIt 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.jsonwould be created. A preview that writes a config file is not a preview.Render the card. The bare command writes to the configured output —
tokenchit.svgunless.tokenchit.jsonnames another path:npx -y @tokenchit/cli@0.10.0 syncAppend only the flags the user actually asked for, each spelled exactly as below. Do not copy a placeholder into the command —
syncignores 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.Flag Effect --out <path>Write somewhere other than the configured output --theme auto|light|darkCard theme; autoadapts to the reader's system--dry-runPrint what would be written and touch nothing syncreads 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.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:
syncprints 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 atdocs/usage.svgis./docs/usage.svgfrom the root README but../usage.svgfromdocs/zh-CN/README.md. Pasting the printed path into a nested README points atdocs/zh-CN/docs/usage.svgand 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
…
Câu hỏi thường gặp
Thẻ hiển thị những thông tin gì?
Tổng số token đã dùng, chi phí gần đúng bằng tiền, chuỗi ngày sử dụng hiện tại và phân bổ mức dùng giữa các công cụ AI khác nhau.
Tôi có cần cài đặt gì không?
Công cụ dùng `npx`, tải chương trình cần thiết ngay khi chạy mà không cài đặt vĩnh viễn trên máy. Bạn chỉ cần đã cài Node.js.
Công cụ này có gửi dữ liệu của tôi đi đâu không?
Không. Nó chỉ đọc nhật ký cục bộ trên máy tính và tạo hình ảnh. Không có gì được gửi lên internet, ngoại trừ việc tải chương trình ban đầu.
Chi tiết
Mô tả gốc của tác giả
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.
repo: affaan-m/ECC
Độ phổ biến
- Sao GitHub
- 280k
- Vị trí xếp hạng
- #426
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
accessibility
280kGiúp agent của bạn tạo giao diện mà ai cũng dùng được, đảm bảo website và app hoạt động tốt với người khuyết tật như người mù hoặc khó vận động.
agent-architecture-audit
280kGiúp agent của bạn kiểm tra xem mọi thứ có hoạt động đúng không, đồng thời tìm và sửa các lỗi trong hệ thống AI để chúng chạy như mong đợi.
agent-eval
280kGiúp agent của bạn so sánh các công cụ lập trình AI khác nhau, đo xem công cụ nào nhanh hơn, rẻ hơn và đáng tin cậy hơn cho từng tác vụ.
agent-harness-construction
280kGiúp agent của bạn hiểu rõ hơn cách thực hiện tác vụ, tối ưu các công cụ và chỉ dẫn mà agent dùng để tăng khả năng thành công.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.