Tare

io.github.priberry-data由 GitHub 帳號 priberry-data 發布v0.2.0更新於 Nov 8, 2026

See where your coding agent's tokens and money went, with cache-safe fixes. Local.

概覽

AI 產生的概覽

讀取本機編碼代理日誌,顯示 token 與花費去向,並提供每次提交成本與提示快取狀態。

可以做什麼
  • 彙整本機編碼代理的花費:API 等價成本、方案額度使用、上下文占用、快取重建與改善建議
  • 比較修正前後的每次提交成本,附 90% 區間或資料不足的提示
  • 檢視單一工作階段紀錄的上下文大小、快取是否仍熱,以及下一則訊息的熱/冷成本
  • 三個工具都在本機執行,依代理留在本機的日誌計價
適用情境
想了解或降低本機 Claude Code、Codex CLI、Gemini CLI、Cline、Roo Code、Kilo Code 的花費時適用,也可在送出下一則訊息前確認提示快取是否仍然有效。
執行需求
透過 npx 以本機 stdio 程序執行(需要 Node.js)。未宣告帳號、API 金鑰、環境變數或標頭。讀取本機既有的代理日誌;僅支援桌面端。
安裝前請注意
會讀取本機代理日誌與工作階段紀錄,其中可能含提示詞、程式碼與工具輸出;README 稱不上傳任何內容、不呼叫模型。MCP 工具為唯讀,但另有的 CLI 指令會修改代理設定(掛鉤、狀態列)並在使用者主目錄下寫入備份。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Tare,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

tare

Same work, fewer tokens, with the receipt.

Your coding agent keeps a log of every API call it makes. Tare reads those logs, prices every token, and shows where the money went: Claude Code, Codex CLI, Gemini CLI, and Cline, Roo Code and Kilo Code in VS Code, Cursor, Windsurf and the other VS Code-based editors. For Codex on a ChatGPT plan it also shows how close you came to the plan's usage limits. Then it cuts the waste without breaking the prompt cache, and proves each saving on your own work. It runs locally, uploads nothing and never calls a model.

npx tarelab
  YOUR AGENT, WRAPPED  · last 30 days · 254 sessions · 79,905 API calls
  $6,720 API-equivalent spend  $623 of it was avoidable (9%)
  Where it went  Reading cached context     ██████████████████████ $3,809  Writing to the cache       ████████████ $2,072  Output (thinking incl.)    █████ $838
  The highlights  › ~82k tokens load before you type a word.  › Coffee-break tax: $722 re-caching after 636 pauses.  › Sub-agents spent $2,734 (41%).

A real month of Priberry's own Claude Code use.

Commands

CommandWhat it does
tareWrapped for the last 30 days. --days N, --all, --json, --logs <dir>
tare cardA 1200×630 shareable card (SVG, with a PNG download) and post text. Nothing is uploaded
tare fixInstalls the output trim and the cache status line. --dry-run, --undo, --scope project
tare receiptCost per commit before and after tare fix, with a 90% range and a finish-rate check
tare statusWhat is installed, and how much output the trim has cut so far
tare setupAdds Tare to every AI coding app on this machine. --dry-run, --undo
tare mcpMCP server over stdio: tare_wrapped, tare_receipt, tare_cache

How the numbers work

  • API-equivalent. Every call is priced at Anthropic's API list prices: fresh input, cache writes (1.25× input for the 5-minute cache, 2× for the 1-hour cache), cache reads and output. On a subscription you pay a flat fee; this is what the same work would cost on the API.
  • Carry cost. A tool's output is written to the cache once and read back on every later call until the conversation is compacted. Tare charges each output for the whole time it stays in context.
  • Cache rebuilds. When most of a prompt is written to the cache again instead of read from it, Tare says why: an idle pause past the cache's lifetime, a model switch, a compaction, or a break.
  • Repeats. A tool call that returned byte-for-byte what the agent already had.

The fixes

Tare cuts waste where it enters the context and never rewrites what's already there, because a rewritten history breaks the prompt cache and costs more than it saves.

  • Output trim (a PostToolUse hook on Bash): output over ~2,500 tokens is cut to the first 40 lines, every line that looks like a failure (with context) and the last 60 lines. The full output is saved in ~/.tare/out/ and the agent is told where.
  • Cache countdown (the status line): how long until the cache goes cold, and what the next message costs warm versus cold. Installed only if you don't already have a status line.

Settings are backed up to ~/.tare/backups/ first, and tare fix --undo removes only Tare's entries.

The receipt

tare receipt compares cost per commit in sessions before and after the fixes, with a bootstrap 90% interval, and checks that as many sessions still reach a commit. With fewer than 8 finished sessions on either side it prints "not enough data" and no number.

In your agent

One command adds Tare to every AI coding app it finds: Claude Code, Claude Desktop, Cursor, VS Code, Windsurf, Codex, Gemini CLI, Kiro, opencode, Amazon Q, LM Studio, and Cline, Roo Code and Kilo Code. The entry is pinned to the exact version, each file is backed up first, and --undo removes it.

npx tarelab setup

Or one app at a time:

  • Claude Code plugin: /plugin marketplace add priberry-data/tarelab, then /plugin install tare@priberry.
  • Gemini CLI extension: gemini extensions install https://github.com/priberry-data/tarelab
  • Skill (Claude Code or Codex): copy skills/tare into ~/.claude/skills/ or ~/.codex/skills/.
  • Any MCP client: {"command": "npx", "args": ["-y", "[email protected]", "mcp"]}. Then ask "what did my agent cost this month?"

Limits

Tare reads the logs that agents keep on your machine. Cursor's own agent, Windsurf's Cascade, Copilot and the browser app builders (Lovable, Bolt, v0, Replit) keep usage on their servers, so Tare can't see them yet; opencode is next. Cline-family costs are the ones the extension itself recorded. The fix and receipt commands work on Claude Code, where the hooks exist. Token counts for tool output are estimated from text length (the API reports totals per call, not per block). Prices are as of 2026-10-06 for Anthropic and 2026-11-08 for OpenAI and Google, and live in src/prices.mjs.

Apache-2.0 · Built by Priberry, who also make Crumple.

來源:README.md,提交 ebdc3b6

工具

3

tare_wrapped

Where this machine's coding-agent tokens and money went (Claude Code, Codex CLI, Gemini CLI, Cline, Roo Code, Kilo Code): API-equivalent spend, plan-limit use, what filled the context, cache rebuilds, highlights and the top fixes with estimated savings. Local and free.

輸入參數days

tare_receipt

Cost per commit before and after Tare's fixes were installed, with a 90% range, or a plain 'not enough data yet'.

無需輸入參數。

tare_cache

For one session transcript: context size, whether the prompt cache is still warm, and what the next message will cost warm versus cold.

輸入參數transcript_path必填

版本歷史

1
  1. v0.2.0最新Nov 8, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分