Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Token Receipt

马自立马自立36 downloads

Turn a day of token usage into a shop receipt

Add to Obsidian
  • Overview
  • Scorecard
  • Updates5

Turn a day of AI coding into a shop receipt.

Token Receipt reads the session logs that Claude Code, Codex and WorkBuddy keep on your computer and prints the day as a till receipt inside Obsidian: tokens by model, cache reads and writes, what it would have cost at API prices, and how much of your plan's limit you used. The receipt rolls out of a thermal printer, lands on a desk or gets pinned to a cork board. Copy it as an image, or save it and drop it into your daily note.

中文说明

A receipt printing out of a thermal printer

That is the author's own day, as an animated SVG saved straight from the plugin.

Contents

  • What is on the receipt
  • Scenes
  • Using it
  • Settings
  • Privacy and file access
  • Limits of the numbers
  • Installation
  • Feedback and updates
  • Credits
  • License

What is on the receipt

  • Claude Code, one block per model: input, output, cache read and cache write tokens, each with its cost at API list prices, plus the number of sessions and requests.
  • Codex, one block per model: input, cached input and output tokens, with costs for the models in the price table.
  • WorkBuddy, one block per model: input, cache hit and output tokens. WorkBuddy has no public per-token price, so this block shows tokens only.
  • Plan limits. When Claude Code tells you that you hit your 5-hour or weekly limit, it writes that message and the reset time into the session log; the receipt lists how many times that happened and when each limit resets. Codex logs the share of your limit you have used, so its block shows that percentage as of the last request of the day.
  • Magpie, if you use it: the receipt adds what Magpie has recorded. That is the share of your plan limits used through the day, how far an account balance dropped, and the requests that went through its gateway. The percentages are for the account Magpie tracks, which may be only one of the accounts you use.
  • Table and seat. The way a restaurant bill carries a table number, the line under the receipt number gives this computer's local network address as the table and its system version as the seat.
  • Totals, a barcode that encodes nothing, and a thank-you.

A tool you did not use that day gets no block.

Scenes

The same receipt can be shown in six ways. They are drawn like a photo taken from above: paper grain and curl, soft shadows, thermal ink that fades and drops dots, wood and cork, a slant of window light. All of it is computed as SVG filters; the plugin ships no images.

Receipts on a wooden desk, a cork board, a notebook page and a clipboard
  • Thermal printer: the receipt feeds out of the slot line by line and ends with a burst of confetti.
  • Wooden desk, Cork board, Notebook and tape, Clipboard: the receipt drops into place; pins and tape follow.
  • Plain: a light background with no lighting, for when you only want the numbers.

The entrance animation plays in the sidebar and in animated SVG files. Saved images show the finished scene.

Using it

Click the receipt icon in the ribbon, or run Open receipt from the command palette. The receipt opens in the right sidebar.

  • The arrows and the date field move between days. A day runs from midnight to midnight in your local time zone.
  • The dropdown picks the scene; the play button replays the entrance.
  • While the view shows today, it recounts every few minutes.
  • Click the receipt to enlarge it: the image is saved and opened in a new tab with Obsidian's image viewer.
  • Copy as image puts a PNG on the clipboard.
  • Save as an image writes Token receipt-YYYY-MM-DD.webp (or .png) to your attachment folder, or a folder you choose. Saving the same day again replaces the file.
  • Save as animated SVG writes a looping .svg that animates wherever SVG images do, including notes and web pages.

Commands, none with a default hotkey:

  • Open receipt
  • Save today's receipt as an image
  • Insert today's receipt at the cursor: saves the image and embeds it in the note you are editing.

Settings

  • Receipt title, language (the interface and the receipt follow Obsidian's language: Chinese for Chinese, English otherwise) and scene.
  • Table and seat, on or off.
  • Session folders for Claude Code, Codex and WorkBuddy, and the Magpie folder, if yours are not in the default place.
  • Image format, folder and resolution. WebP is the default because textured scenes are several megabytes as PNG.
  • Price table, as JSON, in US dollars per million tokens. Prices change and new models appear; edit the table to keep up. A model that is not in the table shows tokens without a cost. The Claude prices come from Anthropic's published rates; the OpenAI ones were taken from third-party price listings, so check them against your bill.

Privacy and file access

  • Files outside your vault. The plugin reads, and never writes, the session logs in ~/.claude/projects (Claude Code), ~/.codex/sessions and ~/.codex/archived_sessions (Codex) and ~/.workbuddy/projects (WorkBuddy). When ~/.config/magpie exists it also reads four files there: usage.jsonl, quota-history.json, balance-history.json and quotas.json. Those are the only places the numbers exist, which is why the plugin needs them. It keeps only the token counts, model names, timestamps, session ids, limit information and balances. Your prompts and the replies are never stored, shown or sent anywhere.
  • Local address and system version. The table and seat line shows this computer's local network address (such as 192.168.1.23) and its system version, both read from the operating system. The line appears on every image you save or copy, so turn it off in the settings if you share receipts and would rather leave it out.
  • No network. Nothing is sent anywhere. Costs are calculated from the price table in the settings.
  • Desktop only, because it reads files through Node.js.
  • The only things written to your vault are the images and SVG files you ask for.

Limits of the numbers

  • Only what is in the local logs is counted. Chats on claude.ai and in the Claude desktop app's chat tab are not there, although they draw on the same plan limits.
  • For Claude, the logs say that you hit a limit, not what percentage of it you used. The percentage appears only when Magpie has recorded it, and then for the one account Magpie tracks.
  • Requests that Claude Code, Codex or WorkBuddy send through the Magpie gateway are counted from their own logs, not a second time from Magpie's.
  • If you use more than one account on the same computer, their sessions are counted together.
  • Costs are estimates at API list prices. On a subscription you do not pay them.

Installation

From Community plugins (once approved): search for “Token Receipt”.

Manually: download main.js, manifest.json and styles.css from the latest release into <your vault>/.obsidian/plugins/token-receipt/, then enable the plugin.

With BRAT: add MatsuriMW/token-receipt.

Feedback and updates

To follow new features, send feedback or keep up with progress, follow me on Twitter: @Matsurimywaifu.

Credits

The idea comes from claude-receipts by Chris Hutchinson, which prints a receipt for each Claude Code session, on a real thermal printer if you have one. Token Receipt shares the idea and none of the code.

This plugin is not affiliated with Anthropic, OpenAI or Tencent.

License

MIT © MatsuriMW


Token 小票

把一天的 AI 编程用量打成一张购物小票。

Token 小票读取 Claude Code、Codex 和 WorkBuddy 存在本机的会话记录,在 Obsidian 里把这一天排成一张收银小票:按模型列出 token、缓存读写、按 API 标价折算的金额,以及订阅额度用了多少。小票会从热敏打印机里走出来,也可以落在桌上、钉在软木板上。可以复制成图片,也可以存下来贴进日记。

小票从热敏打印机里打出来

这是作者自己某一天的用量,是插件直接存出来的动画 SVG。

目录

  • 小票上有什么
  • 场景
  • 怎么用
  • 设置
  • 隐私和文件访问
  • 数字的边界
  • 安装
  • 反馈与后续
  • 致谢

小票上有什么

  • Claude Code:每个模型一栏,列出输入、输出、缓存读、缓存写的 token 和各自按 API 标价折算的金额,以及会话数和请求数。
  • Codex:每个模型一栏,列出输入、缓存读、输出的 token;价目表里有的模型会算出金额。
  • WorkBuddy:每个模型一栏,列出输入、缓存命中、输出的 token。WorkBuddy 没有公开的 token 单价,所以只列 token。
  • 订阅额度:Claude Code 提示 5 小时额度或周额度用满时,会把这条提示和重置时间写进会话记录,小票列出当天用满了几次、各自几点重置。Codex 的记录里有额度已用的百分比,小票印的是当天最后一次请求时的数字。
  • Magpie(用了才有):小票会加上 Magpie 记下来的东西,包括各家订阅额度在这一天里用掉的百分比、账户余额降了多少,以及经它网关转发的请求。百分比是 Magpie 盯的那个账号的,你要是有好几个账号,它可能只是其中一个。
  • 桌号和餐位:像餐厅账单上的桌号那样,单号下面有一行:桌号是本机的局域网 IP,餐位是系统版本。
  • 合计、一个扫不出东西的条形码,和一句谢谢惠顾。

当天没用过的工具不占版面。

场景

同一张小票有六种摆法,都按俯拍静物照的样子做:纸的纤维和卷曲、柔和的投影、会褪色掉点的热敏墨迹、木纹和软木、一道斜着的窗光。这些全是用 SVG 滤镜算出来的,插件里不带任何图片。

木桌、软木板、手账本和账单夹板上的小票
  • 打印机出纸:小票从出纸口一行一行走出来,走完迸一把彩纸。
  • 木桌、软木板、手账胶带、账单夹板:小票落到位,图钉和胶带随后出现。
  • 纯净:浅色底,不加光影,只想看数字时用。

入场动效在侧边栏和动画 SVG 里播放,存下来的图片是定格后的画面。

怎么用

点左侧功能区的小票图标,或在命令面板运行「打开 Token 小票」,小票在右侧边栏打开。

  • 箭头和日期框用来翻日期。一天按本机时区的 0 点到 24 点算。
  • 下拉框选场景,播放按钮重放入场动效。
  • 看今天的小票时,每隔几分钟自动重新统计。
  • 点一下小票可以放大:图片会存下来,并用 Obsidian 自带的图片查看器在新标签页里打开。
  • 「复制成图片」把 PNG 放进剪贴板。
  • 「存成图片」把 Token小票-年-月-日.webp(或 .png)存到附件文件夹,或你指定的文件夹。同一天再存一次会覆盖原来那张。
  • 「存成动画 SVG」存一个循环播放的 .svg,嵌进笔记或网页里会动。

三个命令都没有默认快捷键:

  • 打开 Token 小票
  • 把今天的小票存成图片
  • 把今天的小票插入到光标处:存成图片,并嵌入正在编辑的笔记。

设置

  • 小票抬头、语言(界面和小票跟 Obsidian 的语言走:中文界面用中文,其他用英文)和呈现方式。
  • 桌号和餐位这一行印不印。
  • Claude Code、Codex 和 WorkBuddy 的会话目录,以及 Magpie 的目录,不在默认位置时改这里。
  • 图片格式、存放文件夹和清晰度。默认存 WebP,因为带纹理的场景存成 PNG 要好几 MB。
  • 价目表:JSON 格式,单位是美元 / 百万 token。价格会变,新模型会出,自己改表就行。不在表里的模型只列 token、不算金额。Claude 的价格来自 Anthropic 公布的标价;OpenAI 的几个取自第三方价目汇总,请对照自己的账单核对。

隐私和文件访问

  • 读取库外文件:插件只读、不写 ~/.claude/projects(Claude Code)、~/.codex/sessions 和 ~/.codex/archived_sessions(Codex)、~/.workbuddy/projects(WorkBuddy)里的会话记录。~/.config/magpie 存在的话,还会读里面的四个文件:usage.jsonl、quota-history.json、balance-history.json、quotas.json。这些数字只存在这些文件里,所以必须读它们。插件只留下 token 数、模型名、时间、会话编号、额度信息和余额;你的提问和模型的回答不会被保存、显示或发送到任何地方。
  • 本机地址和系统版本:桌号和餐位那一行印的是本机的局域网 IP(比如 192.168.1.23)和系统版本,都是从操作系统直接读的。存下来或复制出去的图片上都会带这一行,要把小票发给别人、又不想带这两样时,在设置里关掉。
  • 不联网:不向任何地方发送数据,金额按设置里的价目表在本机计算。
  • 仅桌面端:读文件用的是 Node.js。
  • 写进库里的只有你主动导出的图片和 SVG。

数字的边界

  • 只统计本机记录里有的用量。claude.ai 网页版和 Claude 桌面版聊天标签的用量不在本机,但它们和 Claude Code 共用同一份订阅额度。
  • Claude 这边,会话记录只写了额度用满过,没写用了百分之几。只有 Magpie 记过的时候小票才印百分比,而且是 Magpie 盯的那一个账号的。
  • Claude Code、Codex、WorkBuddy 走 Magpie 网关发出的请求,按它们自己的记录算,不会从 Magpie 那边再算一遍。
  • 同一台电脑上用了多个账号的话,它们的会话会合在一起统计。
  • 金额是按 API 标价折算的估算值,订阅用户并不实际支付这些钱。

安装

社区插件市场(审核通过后):搜索「Token Receipt」。

手动安装:从最新版本下载 main.js、manifest.json、styles.css,放进 <你的库>/.obsidian/plugins/token-receipt/,然后启用插件。

用 BRAT:添加 MatsuriMW/token-receipt。

反馈与后续

想追踪后续功能、反馈问题、关注后续进展,欢迎关注我的 Twitter:@Matsurimywaifu。

致谢

点子来自 Chris Hutchinson 的 claude-receipts:它给每个 Claude Code 会话打一张小票,有热敏打印机的话还能真的打出来。Token 小票只借了这个点子,没有用它的代码。

本插件与 Anthropic、OpenAI、腾讯均无关联。

HealthExcellent
ReviewSatisfactory
About
Turn a day of Claude Code, Codex and WorkBuddy token usage into a shop receipt: tokens by model, cost at API prices, plan limits. Watch it print, pick a scene, then copy it or save it as an image or animated SVG. Reads local session logs only.
ImagesExportAttachments
Details
Current version
1.3.1
Last updated
Last month
Created
Last month
Updates
5 releases
Downloads
36
Compatible with
Obsidian 1.5.7+
Platforms
Desktop only
License
MIT
Report bugRequest featureReport plugin
Author
马自立马自立matsurimw
matsuri.site/
GitHubmatsurimw
XMatsurimywaifu
  1. Community
  2. Plugins
  3. Images
  4. Token Receipt

Related plugins

Ink

Handwriting and drawing directly between paragraphs using a digital pen, stylus, or Apple pencil.

Paste image rename

Rename image after pasting, support name pattern and auto renaming.

Imagine

A comprehensive image management plugin for managing, inserting, resizing, viewing, and batch processing images.

Wechat Converter

将 Markdown 转换为微信公众号排版,并支持一键发送到微信(weixin/wx)公众号(支持自定义 CSS和公众号贴图)、飞书、小红书(rednote)、知乎、微博、CSDN等20+平台。

Pixel Perfect Image

Pixel perfect 100% image resizing, copy to clipboard, show image in Finder/Explorer, and much more.

Image auto upload

Upload images from your clipboard by PicGo.

Document Exporter

Export notes, folders, and query results into Markdown bundles, HTML documents, and print-ready exports.

Supernote (Unofficial)

Sync and view Supernote notes and Atelier drawings in your vault

Node Screenshot

Capture node effortlessly with precision screenshot.

Export Image plugin

Easily convert your article to image.