Budget logo

Budget

Community
GeekFamilyCorp
budget

Suit, analyse et optimise la consommation mensuelle de tokens ESTIMÉE par famille de modèle (fast / default / deep, voir models.json) à partir d'un fichier local. Trois modes : `status` (consommation et seuils 50/80/95 %), `analyze` (tendance, projection fin de mois, gaspillages), `optimize` (drapeaux sûrs et réversibles, jamais appliqués sans GO explicite). À utiliser quand l'utilisateur demande « combien j'ai consommé », « budget tokens », « où partent mes tokens », « projection budget », « optimise mon budget », « logge cette conso », ou depuis la tâche planifiée du matin. Ce sont des estimations locales, pas la facturation Anthropic ; en Cowork le hook PostToolUse ne reçoit pas toujours les tokens, d'où une commande de log manuel de repli. Ne pas utiliser pour choisir le modèle d'une tâche (→ model-router) ni pour compresser une sortie (→ caveman).

Overview

PublisherGeekFamilyCorp
RepositoryTricorderKit
Skill namebudget
Stars
32
Forks
1
Bundled files
2
LicenseMIT
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.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

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

Installation

Install the Budget 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/GeekFamilyCorp/TricorderKit/tree/main/cowork-plugins/tk-token-economy/skills/budget
  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/GeekFamilyCorp/TricorderKit.git /tmp/TricorderKit
mkdir -p .claude/skills
cp -r /tmp/TricorderKit/cowork-plugins/tk-token-economy/skills/budget .claude/skills/budget
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Budget 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 Budget 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 Budget 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.

Budget (status · analyze · optimize)

Un seul fichier de données : ~/.tk-token-economy/budget.json (schéma v1.1, archivé chaque mois dans ~/.tk-token-economy/history/). Trois scripts, trois modes.

Honnêteté des chiffres : tout est estimé (poids d'équivalence fast 1/1, default 3/5, deep 15/25 pour input/output). Comparer à l'usage réel et corriger via --calibration avant de trancher un arbitrage.

Alimentation des données

  1. Automatique — hook PostToolUse sur Task (hooks/hooks.json) → budget.py log-from-task. Il ne logge que si le payload contient des compteurs de tokens ; en Cowork ce n'est pas toujours le cas : un statut à 0 ne veut pas dire zéro consommation.
  2. Manuel (repli) — après une exécution significative :
bash
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/budget.py log --model default --in 3200 --out 1800

--model accepte les alias fast / default / deep (ou la famille). Les tokens se lisent dans le résumé d'usage de la session ou s'estiment avec classify.py.

Mode status

bash
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/budget.py status          # lisible
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/budget.py status --json   # pour model-router / tâche planifiée

Seuils et politique d'escalade retournée (escalation_policy) :

RatioAlerteEffet sur model-router
< 50 %OKrien
50–80 %INFOrappel discret
80–95 %WARNINGdowngrade_one_tier sauf « critique »
≥ 95 %CRITICALforce_haiku sauf « critique » / « urgent »

Configuration : budget.py set-budget --total N --haiku 0.6 --sonnet 0.3 --opus 0.1 --calibration 1.0 --alert-mode informative|enforcing. Détail dans references/budget-config.md et references/alerts.md. Reset manuel : budget.py reset (l'historique est conservé).

Mode analyze

bash
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/budget_analyzer.py              # rapport
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/budget_analyzer.py --json
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/budget_analyzer.py --recommend

Produit : répartition par famille, conso/jour, projection fin de mois, ETA des seuils, gaspillages (opus_sous_utilise, sortie_longue_sans_compression, taches_repetitives_offload_local) et recommandations séparées en auto-applicables / à proposer. Peu fiable sous ~20 événements : le dire.

Mode optimize

bash
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/optimizer.py analyze     # dry-run : toujours commencer ici
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/optimizer.py status
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/optimizer.py apply       # SEULEMENT après GO explicite (R53)
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/optimizer.py rollback --last

apply n'écrit que des drapeaux bornés et réversibles (haiku_reroute, force_haiku, caveman_default, score_bias) dans auto_state, journalisés avec point de rollback. Règle : en session interactive, présenter le dry-run et attendre le GO de l'utilisateur ; en tâche planifiée, ne jamais lancer apply, seulement analyze et le remonter. Effet des drapeaux sur le routage : ${CLAUDE_PLUGIN_ROOT}/skills/model-router/references/auto-budget.md.

Tout le reste (changer le budget total, créer des règles d'offload local, toucher un domaine sensible) reste une proposition.

Restitution type

Budget 2026-09 (estimation) : 12,4 M / 20 M eq (62 %) — INFO
  fast 52 % · default 85 % [WARNING] · deep 57 %
Projection fin de mois : 96 % → seuil 95 % atteint vers le 27
Données : 143 événements (hook) + 2 logs manuels — calibration ×1.0 non vérifiée

Références

  • references/budget-config.md — schéma de budget.json, poids d'équivalence, rétention
  • references/alerts.md — niveaux d'alerte et overrides
  • ${CLAUDE_PLUGIN_ROOT}/references/regles.md — R53 (GO avant action), R31 (NO-DROP), R54 (doctrine de routage)

Changelog

  • 2026-09-07 — v2.0 : fusion de budget-tracker + budget-analyzer + auto-optimize en un skill à trois modes ; apply conditionné au GO explicite ; commande log --model <alias> --in --out de repli ; retrait des cibles d'offload Antigravity/Gemini ; chiffres annoncés comme estimations.
  • 2026-04 — v1.x : trois skills séparés (lots L1–L3 du plan auto-budget).

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Budget AI skill do?

Suit, analyse et optimise la consommation mensuelle de tokens ESTIMÉE par famille de modèle (fast / default / deep, voir models.json) à partir d'un fichier local. Trois modes : `status` (consommation et seuils 50/80/95 %), `analyze` (tendance, projection fin de mois, gaspillages), `optimize` (drapeaux sûrs et réversibles, jamais appliqués sans GO explicite). À utiliser quand l'utilisateur demande « combien j'ai consommé », « budget tokens », « où partent mes tokens », « projection budget », « optimise mon budget », « logge cette conso », ou depuis la tâche planifiée du matin. Ce sont des es...

Why use Budget on TypingMind?

Because you install it once and use it with any model. Budget 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 Budget in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/GeekFamilyCorp/TricorderKit/tree/main/cowork-plugins/tk-token-economy/skills/budget. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Budget?

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 Budget?

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

Is the Budget AI skill free?

Yes. It is published on GitHub by GeekFamilyCorp under the MIT 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 👇