Logo vun Melech Cost

Melech Cost

Communautéit
AdirD
melech-cost

Show what coding-agent sessions cost for every worktree of the current repo — Cursor, Claude Code, and Codex — as handoff-style cards with dollars and tokens. Use when the user asks how much a repo, worktree, task, or session cost, wants a spend breakdown, or invokes `/melech-cost`.

Iwwersiicht

EditeurAdirD
Repositoryagent-shell-hamelech
Skill-Nummmelech-cost
Stären
46
Forks
5
Matgeliwwert Fichieren
3
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 3 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum AdirD op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Melech Cost an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/AdirD/agent-shell-hamelech/tree/main/skills/melech-cost
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AdirD/agent-shell-hamelech.git /tmp/agent-shell-hamelech
mkdir -p .claude/skills
cp -r /tmp/agent-shell-hamelech/skills/melech-cost .claude/skills/melech-cost
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Melech Cost an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Melech Cost automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Melech Cost net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Melech Cost

Answer "what did this repo cost me, and which task burned it?" from local agent history. One script does all the work; the agent only runs it and relays the result.

text
/melech-cost                      # every worktree of this repo, top 8 cards
/melech-cost last 10              # 10 most recent sessions across all worktrees
/melech-cost <worktree>           # one worktree, its top 10 sessions
/melech-cost since 2026-09-01     # only sessions active since a date

Run

Set COST_SCRIPT to scripts/cost.py beside this file (Python 3.9+):

bash
python3 "$COST_SCRIPT" --cwd "$PWD"                        # default view
python3 "$COST_SCRIPT" --cwd "$PWD" --latest 10            # latest 10 sessions across all worktrees
python3 "$COST_SCRIPT" --cwd "$PWD" --worktree feature-a   # focus one worktree
python3 "$COST_SCRIPT" --cwd "$PWD" --since 2026-09-01     # date filter
python3 "$COST_SCRIPT" --cwd "$PWD" --cards 20             # more cards

Relay stdout as-is. It is already Markdown: a repo header, one card per worktree, and a footnote. Do not recompute, round differently, re-sort, or add numbers the script did not print. End with the Full report: path so the user can open every worktree. Do not read the full report unless asked.

Card shape:

text
### `feature-a` · ~$321
26d ago · 22 sessions + 36 subagents · cursor, claude · mostly `gpt-5.6-sol` (79%)
~394.1M tokens read (98% cached) · ~717k written

| Age | Cost | Read / Write Tokens | Model | Agent | Session | Topic |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| 1.4d ago | **~$187** | ~250.0M / ~400k | `gpt-5.6-sol` | cursor (+20) | `c747b3dc` | Users locked out after the SSO change… |
| 2d ago | **~$51** | ~80.0M / ~150k | `claude-opus-5-5` | claude | `bf32eff9` | Fix mode keeps editing the wrong file… |

(removed) marks a worktree that no longer exists on disk but still has history. Subagent spend rolls into the session that spawned it.

How it works

Scope: this repo only, every worktree. git worktree list gives the main checkout and every live worktree, wherever it lives (Superset, Cursor, Codex, Claude Code, or a plain sibling folder). A folder that holds this repo's worktrees and no other repo's checkout also counts, so history from removed worktrees in that folder is included. The main checkout's parent folder (for example ~/code) never counts, so sibling repos stay out.

Sources and accuracy:

AgentWhereTokens
Claude Code~/.claude/projects/**/*.jsonlExact: logged per message (input, cache write, cache read, output)
Codex~/.codex/sessions/**, archived_sessions/**Exact: last token_count total per session
Cursor CLI~/.cursor/chats/*/<id>/store.dbEstimated: replays the stored ordered conversation
Cursor IDEstate.vscdb + ~/.cursor/projects/*/agent-transcriptsEstimated: replay calibrated against Cursor's own context counter

Pricing. Tokens × list price per model from references/prices.json (dated, per 1M tokens, sourced from Cursor's, Anthropic's, and OpenAI's pricing pages). The first matching rule wins. Unknown models, such as Auto, use a fallback rate, and the footnote says how much that affected. Results are API list-price value. On a subscription, part of it is covered by included usage.

Cursor replay. Cursor stores no billing counters locally, so each session is replayed call by call:

  • Every model call re-reads the prior prompt at the cached rate.
  • New context (your message and tool results since the last call) is billed at the cache-write or input rate.
  • The model's reply is billed at the output rate.
  • When the context passes the model's limit, a summary resets it.

The IDE store drops file-read and search results. The replay therefore scales each session to match Cursor's own "context tokens used" breakdown; sessions without that breakdown use the median of this run's sessions, or 2.4× if there are too few samples. Treat Cursor numbers as about ±30–40%. Hidden reasoning tokens and cache misses after idle gaps aren't visible, so they push the true number up.

What it costs to run

The script is plain local Python: no model tokens and no network. It takes about 10–40 seconds depending on history size. The only spend is the agent turn around it: about three model calls that add ~3k new tokens (this skill, the command, and the printed cards) plus ~1k output tokens, on top of re-reading whatever the chat already holds.

Where you run itOpus 5.5 / GPT-5.6 SolComposer 2.5
Inside an existing chat (~50k context)~$0.05–0.10~$0.03
As the first message of a fresh chat~$0.25 (writing the agent's own ~40k system prompt to cache)~$0.05

More --cards means more output tokens: roughly +$0.01 per 3 extra cards on frontier models.

Boundaries

  • Read-only. Cursor CLI stores are copied to a temp dir to read past SQLite locks, then deleted. The only file written is the full report in the system temp dir (or --report PATH).
  • History is private. Never upload, publish, or paste it anywhere else without explicit instruction.
  • Prices go stale. When a provider changes pricing, update prices.json and its as_of date instead of hand-adjusting printed numbers.
  • Agents without a supported local store (for example SQLite-only or encrypted histories) are not counted. Say so if the user expects them.

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Melech Cost?

Show what coding-agent sessions cost for every worktree of the current repo — Cursor, Claude Code, and Codex — as handoff-style cards with dollars and tokens. Use when the user asks how much a repo, worktree, task, or session cost, wants a spend breakdown, or invokes `/melech-cost`.

Firwat Melech Cost op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Melech Cost besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Melech Cost an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/AdirD/agent-shell-hamelech/tree/main/skills/melech-cost an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Melech Cost benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Melech Cost benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Melech Cost domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Melech Cost gratis?

Jo. De Skill gëtt vum AdirD ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇