usage-tracker

usage-tracker is a skill for Claude Code from j4rk0r/claude-skills. It costs 194 tokens per session (3,329 once invoked), scanned C, original, MIT.

A local tracker for Claude Code usage, recording tokens, estimated euro cost, sessions, projects, and tool activity for each request. It groups the tool calls caused by the same user message into one request.

In plain words
What is it for?
Reporting usage and estimated cost, comparing requests, finding costly sessions or projects, and investigating which tool calls contributed to a request.
Why use it?
It shows which requests and tools consume the most usage instead of leaving costs spread across separate log entries. This helps investigate expensive requests or unexpected consumption.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions Claude Code.

Good fit Reporting usage and estimated cost, comparing requests, finding costly sessions or projects, and investigating which tool calls contributed to a request.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/j4rk0r/claude-skills/usage-tracker
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add j4rk0r/claude-skills --skill usage-tracker
Clone the repo
git clone --depth 1 https://github.com/j4rk0r/claude-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for usage-tracker

README.md
[![agentmods](https://agentmods.dev/badge/skills/j4rk0r/claude-skills/usage-tracker/github.svg)](https://agentmods.dev/skills/j4rk0r/claude-skills/usage-tracker)
Your own site
<a href="https://agentmods.dev/skills/j4rk0r/claude-skills/usage-tracker"><img src="https://agentmods.dev/badge/skills/j4rk0r/claude-skills/usage-tracker/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for usage-tracker

Your own site · 80×15
<a href="https://agentmods.dev/skills/j4rk0r/claude-skills/usage-tracker"><img src="https://agentmods.dev/badge/skills/j4rk0r/claude-skills/usage-tracker.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 194 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,329 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00194 $0.03329
Opus 5 $0.00097 $0.01665
Sonnet 5 $0.00039 $0.00666
Haiku 4.5 $0.00019 $0.00333

Measured 9d ago against content hash ac24e122d063, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade C, and why

usage-tracker scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (references/log-usage.sh, references/usage-report.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- Si `chmod` falla (permiso denegado): verificar propietario con `ls -la` y usar `sudo chmod` solo si es necesario.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

cat ~/.claude/usage.jsonl | python3 -c "
skills/usage-tracker/SKILL.md · 243 lines

How it starts

The opening of the file, as written. The whole thing — 243 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Usage Tracker

Gestiona el sistema de logging de consumo local de Claude Code y permite analizar el coste por petición del usuario.

Referencias

Archivo Cuándo cargar
references/pricing.md MANDATORY al calcular o explicar costes en €
references/log-usage.sh MANDATORY en install si el hook no existe
references/usage-report.sh MANDATORY en install si el script no existe
No cargar los scripts Para report, top-requests y status — solo se ejecutan

Cómo funciona el coste por petición

Cada mensaje del usuario dispara múltiples tool calls en secuencia. El log registra cada tool call con el campo request = último mensaje del usuario que lo originó. Esto permite agrupar todos los tool calls de una petición y calcular su coste total.

Usuario: "revisa el módulo delsol"
  └─ Read delsol.module           → 1.200 tok   ┐
  └─ Grep hook_order              → 80 tok      │ mismo "request"
  └─ Read DelsolService.php       → 2.400 tok   │ → coste total: 4.980 tok
  └─ Bash phpcs delsol/           → 1.300 tok   ┘

Para ver el coste por petición:

cat ~/.claude/usage.jsonl | python3 -c "
import json, sys
from collections import defaultdict

req = defaultdict(lambda: {'tok':0,'tools':[],'ts':''})
for line in sys.stdin:
    try:
        d = json.loads(line.strip())
        r = d.get('request','—')[:80]
        req[r]['tok']   += d.get('tok_total',0)
        req[r]['ts']     = d.get('ts','')[:10]
        req[r]['tools'].append(d.get('tool','?'))
    except: pass

print(f'{'Tokens':>8}  {'Tools':>5}  Petición')
print('-'*80)
for r, v in sorted(req.items(), key=lambda x: -x[1]['tok'])[:15]:
    print(f'{v[\"tok\"]:>8,}  {len(v[\"tools\"]):>5}  {r}')
"

Framework: antes de enviar una petición costosa

Antes de ejecutar, evalúa:

  • ¿Necesitas el archivo completo? — Usa offset/limit en Read si solo necesitas una sección concreta.
  • ¿Esta tarea es independiente? — Si sí, ábrela en una conversación nueva. El contexto acumulado puede multiplicar el coste real por 5-10x.
  • ¿Puedes confirmar antes de leer? — Un Grep previo que verifica que el contenido existe evita un Read masivo en falso.
  • ¿Hay un Agent call implícito? — Si la petición requiere "analizar todo X", anticipar que el coste real será 10-100x lo que mostrará el log.

Read the full file on GitHub · 243 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 243 lines · 194 tokens per session scan C ac24e122d063

Subscribe to this mod's changes

usage-tracker is a skill published in the GitHub repository j4rk0r/claude-skills (2 stars, last pushed 1mo ago), licensed MIT. It adds 194 tokens to every session and 3,329 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it C with 2 findings (asks for root, reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

shipkit-work-memory

Log session progress and save resume state. Infers from conversation and git. Triggers: 'log progress', 'session summary', 'checkpoint', 'save progress', 'end session'.

stefan-stepzero/shipkit · 42 tokens

session-update

Use when the user says "update session", "log progress", "checkpoint session", or invokes /session-update — especially before /clear or handoff.

jkm-4314/claude-code-skills · 33 tokens

compact-manual

Claude Code skill for deterministic context compaction. Compresses the current Claude Code session to the clipboard for a manual rewind+paste workflow. A deterministic alternative to /compact that extracts literal dialog and truncates only tool outputs — no LLM summarization. Use when the user says 'compact the…

mario-hernandez/claude-compact-manual · 81 tokens

suede-onboarding

Suede-affiliated onboarding and activation strategy for first-run sequencing, empty states, setup checklists, activation milestones, time to value, and retention-linked measurement. Use when users sign up but fail to reach first value or the product needs a new first-session flow. NOT FOR: registration optimization…

JasonColapietro/suede-creator-skills · 88 tokens

quick-win-session

Generates guided first-action flows that help users achieve a meaningful result within 60 seconds to boost retention. Use when user wants quick win onboarding, time-to-value optimization, or first success moments.

rshankras/claude-code-apple-skills · 43 tokens

google-apps-script

Build Google Apps Script automation for Sheets and Workspace. Custom menus, triggers (onEdit / time-driven / form submit), dialogs, sidebars, email batches, PDF export, external API. Use whenever the user wants to automate a Google Sheet, build a Sheets menu / sidebar / dialog, hit a Sheets row from email or a…

jezweb/claude-skills · 89 tokens