Cost Tracker logo

Cost Tracker

Community
felvieira
cost-tracker

Skill de rastreamento de custo por sessao. Monitora tokens consumidos, chamadas de API (fal.ai, Brave, Firecrawl), tempo de execucao e custo estimado por skill no pipeline. Gera relatorio de custo ao final da sessao. Trigger em: "custo", "cost", "quanto gastou", "token usage", "consumo", "budget", "relatorio de custo".

Overview

Publisherfelvieira
Repositoryclaude-skills-fv
Skill namecost-tracker
Stars
28
Forks
5
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by felvieira on GitHub. Read the source before you install it.

Installation

Install the Cost Tracker AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/felvieira/claude-skills-fv/tree/main/skills/30-cost-tracker
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/felvieira/claude-skills-fv.git /tmp/claude-skills-fv
mkdir -p .claude/skills
cp -r /tmp/claude-skills-fv/skills/30-cost-tracker .claude/skills/cost-tracker
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Cost Tracker in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Cost Tracker on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Cost Tracker is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Cost Tracker

O Cost Tracker monitora e consolida os custos de cada sessao de trabalho. Rastreia tokens consumidos por skill, chamadas de API externas, tempo de execucao e modelo utilizado, gerando um relatorio detalhado de custo estimado ao final da sessao.

Governanca Global

Esta skill segue GLOBAL.md, policies/execution.md, policies/persistence.md, policies/token-efficiency.md, policies/tool-safety.md, policies/handoffs.md, policies/evals.md, policies/memory-tiers.md e policies/memory-consolidation.md (sugerir /consolidate-memory quando vault crescer demais).

Quando Usar

  • ao final de uma sessao para consolidar custos
  • quando o usuario perguntar quanto custou ou qual o consumo
  • quando o pipeline for longo e envolver multiplas skills
  • quando o objetivo for otimizar gastos e identificar skills mais caras

Quando Nao Usar

  • para decisoes de negocio baseadas em custo real de infra
  • para substituir billing real de provedores (fal.ai, Brave, Firecrawl)
  • para estimar custo de infraestrutura de deploy ou hosting

Entradas Esperadas

  • pipeline executado e skills acionadas
  • chamadas de API externas realizadas (fal.ai, Brave, Firecrawl)
  • metadata de respostas LLM (tokens de entrada/saida)

Saidas Esperadas

  • relatorio em docs/cost-reports/session-YYYY-MM-DD.md
  • resumo de custo por skill
  • total estimado da sessao

Responsabilidades

  1. Rastrear tokens consumidos por skill durante o pipeline
  2. Contabilizar chamadas de API externa (fal.ai, Brave Search, Firecrawl)
  3. Calcular custo estimado com base no modelo usado e volume de tokens
  4. Gerar relatorio estruturado de custo da sessao
  5. Persistir historico de custos para comparacao entre sessoes

Metricas Rastreadas

MetricaFonteExemplo
Tokens consumidosLLM response metadata12.400 input / 3.200 output
Chamadas API fal.aiContagem por tool call3 chamadas (image gen)
Chamadas API BraveContagem por tool call5 chamadas (search)
Chamadas API FirecrawlContagem por tool call2 chamadas (scrape)
Tempo de execucaoTimestamps inicio/fim14min 32s
Modelo usadoModel Routing policyclaude-sonnet-4-20250514

Memory Tiers e Decay

O Cost Tracker também monitora a saúde dos tiers de memória ao final de cada sessão:

  • Learned-skills com score baixo (< 0.3): listar para arquivamento
  • Learned-skills candidatas à promoção (score ≥ 0.8): sinalizar para skill 35
  • Tamanho do devkit_context_pack: alertar se exceder 500 tokens por entrada

Ver policies/memory-tiers.md para a lógica completa de score e decay.

Formato do Relatorio

markdown
# Relatorio de Custo — Sessao YYYY-MM-DD

## Pipeline Executado
[nome do pipeline ou descricao]

## Skills Acionadas
| Skill | Tokens (in/out) | API Calls | Custo Estimado |
|---|---|---|---|
| Repo Auditor | 8.000 / 2.100 | 0 | $0.03 |
| Frontend Integration | 15.000 / 5.200 | 2 fal.ai | $0.12 |

## Chamadas de API Externa
| Provedor | Quantidade | Custo Estimado |
|---|---|---|
| fal.ai | 2 | $0.08 |
| Brave Search | 5 | $0.01 |

## Resumo
- **Total de tokens**: 45.600 input / 14.300 output
- **Total de chamadas API**: 7
- **Custo total estimado**: $0.25
- **Duracao da sessao**: 14min 32s

Integracao com Outras Skills

  • Orchestrator (09): aciona o Cost Tracker ao final do pipeline para gerar relatorio
  • Model Routing (policy): fornece o tier de modelo usado por skill/subagent, impactando o calculo de custo. Ver policies/model-routing.md
  • Todas as skills: reportam consumo de tokens e chamadas no handoff (bloco tokens_in/tokens_out/api_calls no handoff estruturado da skill, seguindo policies/handoffs.md) — sem isso o Cost Tracker não tem de onde puxar o número, e não deve inventar estimativa não-declarada

Checkpoint antes de gerar o relatório: somar os totais por skill e conferir contra o total geral — se a soma das partes não bater com o total (skill reportou tokens mas não entrou na soma, ou duplicou), corrigir a consolidação antes de persistir. Um relatório com totais que não fecham é pior que nenhum relatório.

Evidencia de Conclusao

  • relatorio de custo gerado em docs/cost-reports/
  • metricas de tokens e chamadas API coletadas
  • historico de custos atualizado

Handoff

Entregar:

  • caminho do relatorio de custo
  • highlight das skills mais caras da sessao
  • recomendacao de otimizacao (ex: usar modelo menor, reduzir chamadas)

Seguir policies/handoffs.md.

Codigo Limpo

Manter relatorios concisos, metricas precisas e formatos consistentes entre sessoes.

Frequently asked questions

What does the Cost Tracker AI skill do?

Skill de rastreamento de custo por sessao. Monitora tokens consumidos, chamadas de API (fal.ai, Brave, Firecrawl), tempo de execucao e custo estimado por skill no pipeline. Gera relatorio de custo ao final da sessao. Trigger em: "custo", "cost", "quanto gastou", "token usage", "consumo", "budget", "relatorio de custo".

Why use Cost Tracker on TypingMind?

Because you install it once and use it with any model. Cost Tracker is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Cost Tracker in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/felvieira/claude-skills-fv/tree/main/skills/30-cost-tracker. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Cost Tracker?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Cost Tracker?

As many as you like. As long as a model supports skills, you can use Cost Tracker with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Cost Tracker AI skill free?

Yes. It is published on GitHub by felvieira under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇