affaan-m/ecc

token-card

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.

Ver código fuente

Cómo usar

  1. Copia el comando y revisa el paquete antes de instalarlo en tu entorno de agente.
  2. Consulta las herramientas, credenciales y entornos necesarios en el documento original.
  3. Describe las entradas y el resultado deseado; contrasta la salida con las fuentes.
npx skills add https://github.com/affaan-m/ecc --skill token-card

Antes de empezar

  • La instalación no incluye suscripción al modelo, cuota API ni permisos sobre tus archivos.
  • Las estrellas e instalaciones reflejan actividad, no una prueba independiente de calidad o seguridad.
Documento original del Skill

Contenido del repositorio de origen con títulos, ejemplos, código, tablas, enlaces e imágenes preservados.

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:

bash
TOKENCHIT_VERSION=0.10.0

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

bash
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.

  1. Configure, unless this is a dry run. If .tokenchit.json is absent, run:
bash
   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.

  1. Render the card. The bare command writes to the configured output — tokenchit.svg

unless .tokenchit.json names another path:

bash
   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.

  1. 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:

markdown
   ![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.

Relacionados por tarea

del mismo repositorio

Más Skills

Todos los Skills
affaan-m
Comunidad

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

instalaciones
4
GitHub Stars
286,1 mil
Actualizado
20 oct
affaan-m
Comunidad

autonomous-loops

Patterns and architectures for autonomous Claude Code loops — from simple sequential pipelines to RFC-driven multi-agent DAG systems. Retained for compatibility only: when new autonomous loop guidance is needed, use continuous-agent-loop instead.

instalaciones
4
GitHub Stars
286,1 mil
Actualizado
20 oct
affaan-m
Comunidad

coding-standards

Baseline cross-project coding conventions for naming, readability, immutability, and code-quality review. Use detailed frontend or backend skills for framework-specific patterns. Use when reviewing code quality or naming with no framework-specific skill that applies.

instalaciones
4
GitHub Stars
286,1 mil
Actualizado
20 oct
affaan-m
Comunidad

configure-ecc

Run the conversational ECC setup wizard inside the current harness: inventory the install, collect scope (user/project/local) and hook mode (off/minimal/standard/strict) in Claude Code, use Codex's native plugin lifecycle, or install the project surface under ./.kimi-code, then preview, apply, and verify. Use when installing, updating, reconfiguring, or repairing an ECC installation, changing hook profiles, or moving ECC between install scopes.

instalaciones
4
GitHub Stars
286,1 mil
Actualizado
20 oct