慣性聚合 高效追蹤和閱讀你感興趣的部落格、新聞、科技資訊
閱讀原文 在慣性聚合中打開

推薦訂閱源

小众软件
小众软件
博客园 - 叶小钗
有赞技术团队
有赞技术团队
大猫的无限游戏
大猫的无限游戏
博客园_首页
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LangChain Blog
Hugging Face - Blog
Hugging Face - Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
aimingoo的专栏
aimingoo的专栏
Blog — PlanetScale
Blog — PlanetScale
爱范儿
爱范儿
T
Tailwind CSS Blog
Jina AI
Jina AI
量子位
Stack Overflow Blog
Stack Overflow Blog
人人都是产品经理
人人都是产品经理
J
Java Code Geeks
V
Visual Studio Blog
月光博客
月光博客

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - amitb-quantum/roboapi: The unified API layer for robotics. Connect any robot, any brand, with one SDK. Like Stripe, but for robots. GitHub - manankharwar/fusioncore: ROS 2 sensor fusion SDK: UKF, 3D native, proper GNSS, zero manual tuning. Apache 2.0. Show HN: Wayland Wlroot Hjkl Everywhere Show HN: Codex context bloat? 87% avg reduction on SWE-bench Verified traces GitHub - NoahCristino/llmcat: A simple CLI that transforms your code into clean, structured text for feeding into LLMs. GitHub - actuallyepic/background-computer-use GitHub - h4ckf0r0day/obscura: The headless browser for AI agents and web scraping GitHub - anthonybudd/Express-ts-API-Template: Production-ready minimal REST API boilerplate using Express.js, Sequelize and MySQL. GitHub - molefrog/lilmd: Agent-friendly CLI for reading large Markdown files Show HN: I built a simple site to reduce tool overload and improve focus GitHub - JonathanRosado/claude-anyteam: Native Claude Code teammates, any LLM. Codex today. Gemini, Kimi, GLM, DeepSeek next. GitHub - abi/lilo Show HN: ffmpeg-render-pro – Parallel video rendering with live dashboard GitHub - adam-s/HNswered: Notifies you when someone replies to your Hacker News posts and comments. GitHub - arian-gogani/nobulex: The accountability primitive for AI agents. Cryptographic behavioral commitments with trustless verification. GitHub - Developing-Gamer/roids: Steroids for your AI agents GitHub - nellavio/nellavio: 🚀 Next.js dashboard starter with auth, i18n, 18 pages, 60+ charts and 90+ UI components Spotify – Web Player GitHub - tillahoffmann/cctape: Claude proxy to record all interactions in a local database, allowing you to browse and search sessions, track usage, and let Claude search its own history over MCP. Show HN: Rook, a macOS notes app for developers GitHub - donchuru/mr-links: Chrome extension that shows referenced links above comments on Marginal Revolution assorted links posts GitHub - anubhavgupta/whisper-npu: Speech to text at cursor using NPU. (shortcut -> win+/) SHOW HN: I built a marketplace agency that treats profit as the actual metric GitHub - trycua/cua: Open-source infrastructure for Computer-Use Agents. Sandboxes, SDKs, and benchmarks to train and evaluate AI agents that can control full desktops (macOS, Linux, Windows). GitHub - montanaflynn/headless-terminal: Headless terminal — puppeteer for TUIs (vim/emacs/htop/nethack) with a Go CLI backed by libghostty-vt The Genesis of TurboPentest.com: Bridging the Gap in an AI-Code Explosion Era GitHub - VincenzoManto/Doxa: A YAML-driven multi-agent simulation platform for economic and social systems. It combines LLM-backed agents, market microstructure, relation graphs, and world events behind a FastAPI API and a React client. GitHub - IdreesInc/PokeMesh: Collaborative Pokémon over a decentralized network, no internet required! GitHub - tamnd/python-one: Historical Python source tarballs (1.0.1 through 2.0c1) mirrored from legacy.python.org, extracted and committed at their original release dates. GitHub - dixalex/decision-linter: Decision Linter — like ESLint for your thinking. Claude Code plugin that scores assumptions, runs consider-the-opposite, and outputs judgment memos. GitHub - pitermarx/Virgulas: An Workflowy Inspired Outliner Show HN: A standalone YouTube Music popup for OBS (no plugins required) GitHub - polotno-project/render-tag: Render HTML string into canvas using 2d native API libgoc/bench/README.md at 81798b3dd5e27d7f1e752b6cff0bdf3a95d381b7 · libgoc/libgoc Show HN: Llm.sql – Run a 640MB LLM on SQLite, with 210MB peak RSS and 7.4 tok/s GitHub - RivoLink/leaf: Terminal Markdown previewer — GUI-like experience. [China AI News] Eight Chinese chip families ran DeepSeek V4 on launch day GitHub - michaelaz774/decision-engine: A decision operating system for startup founders, powered by Claude Code. Synthesizes wisdom from 25+ legendary founders and investors into interactive AI-driven decision frameworks. Sheetflow App - Webflow Apps & Integrations Questly — The Third Rail GitHub - crufter/safer: Sleep better while AI agents have shell access. gitrails/README.md at main · maxawzsinger/gitrails Show HN: RustNmap | Hacker News GitHub - 0x0funky/agent-sprite-forge: Agent Skill for generating 2D sprite sheets, transparent PNG frames, and animated GIFs from prompts. Submissions from github.com/darshanfofadiya | Hacker News GitHub - seb3773/ntfs-repair-rfc: A legally defensible, industry-grade blueprint for building an open-source NTFS structural repair engine from scratch. TOSTask - Chrome 应用商店
coral-ai/claude-code-token-xray 在 main · Coral-Bricks-AI/coral-ai
Hiteshjain11 · 2026-05-28 · via Hacker News: Show HN

Stars License: Apache 2.0 Python

反工程您自己的本地Claude Code日誌一個月 (~/.claude/projects/*/*.jsonl),以查詢代碼、時間和費用實際流向 — 並在您的環境上運行。僅讀取本地日誌;沒有任何數據會發送到任何地方。

Token consumption per task, before vs. after the Opus 4.7 upgrade — ~4× on the same work

它發現了什麼 (我自己的三十一天日誌 — 181次會話,25,564次模型調用):

  • 您不需要付費生成,您需要付費重新讀取。 ~29M 獨特 token → 4.35B 收費 (~150×),因為每次輪流都重新發送整個 ~173K-token 的上下文。
  • 費用是 84% 輸入 / 16% 輸出 — 而重新讀取相同的上下文是 64%
  • 最大的線是您永遠看不到的那條:隱藏的推理佔了84%的輸出 約60%的重新讀取.
  • 約$3,371,在Opus 4.7清單價格下。快取已經服務了98%的輸入—而重新讀取仍然64%的費用。

完整報導(所有表格、原因、主線程與子代理的劃分)→ coralbricks.ai/blog/claude-code-token-xray

快速啟動

pip install -r requirements.txt   # just tiktoken
python3 token_time_breakdown.py
python3 cost.py
python3 main_vs_sidecar.py
python3 reread_breakdown.py

tiktoken 是 OpenAI 的分詞器,不是 Claude 的,所以分詞 比例 相對準確到 ±15%,不是 Claude 的精確值。cost.py 中的計費分詞數據直接來自 APIusage 會阻擋並且完全精確。

這個月花費

cost.py 開始,價格為 Opus 4.7 的列表價格:

行項目 花費 分配比例
輸入 — 重新讀取上下文(緩存讀取) $2,176 64%
輸入 — 緩存寫入 $682 20%
輸入 — 新鮮 (未快取) $2 0%
輸出 — 推理 $429 13%
輸出 — 工具調用 + 摘要 $82 2%
總計 $3,371 100%

快取是唯一讓它保持正常的東西 — 沒有它,相同的任務清單將 ~$22,630 (~7×)。您的數字會不同;那就是重點。在您的上運行它.

腳本

  • token_time_breakdown.py — 标題表格:權杖(標記輸入/輸出) 每個活動的實際執行時間(推理、執行指令、撰寫工具呼叫、子代理、摘要、閱讀/搜尋、編輯)加上被動上下文列(系統提示 + 工具、附件、輸入的提示、注入的提醒)。單次通過,所以 token 和時間保持一致。推理不會以明文儲存(僅僅是加密簽名),所以透過減法來恢復:output − tool_calls − summaries時間是由事件時間戳記重建的。
  • cost.py — 總計收費的 token 數量(cache 讀取 / cache 寫入按 TTL / 新鮮輸入 / 輸出)以 Opus 4.7 清單價格計費,加上無 cache 的反事实情況.
  • main_vs_sidecar.py — 將由人類驅動的主線程與產生的子代理分開(記錄在嵌套的 */subagents/*.jsonl 下);報告收費的 token 數量、每個模型的混合比例、cache 命中率、每個代理的回合數(主線程為每個會話,側邊車為每個子代理),以及每個的成本,加上總計。
  • reread_breakdown.py — 每次活動的累積輸入:重播每個會話的上下文成長以顯示每種類型的上下文在每次重讀時的成本。報告uniquere-read每個活動的代碼(推理是最主要的重讀行)。重播是根據測量的應收輸入(精確)進行縮放的;每個活動的分割是一個模型.

注意事項

  • 一個人使用一台機器的一個月 — 方向性,不是基準。Claude Code 是動態的,所以你的分佈會不同。那就是重點:在你的機器上運行它。
  • 世代差距也包括模型在寫入前閱讀其上下文;Bash 時間是實際執行(命令自動批准),但在背景中運行的代碼或一個分離的終端不會被計算。
  • 系統提示列是從每個會話的第一個快取寫入估計出來的.

這對你有幫助嗎?

如果這幫助你了解你的 Claude Code tokens、時間和實際花費的成本, 請 ⭐ 這個倉庫 — 它能幫助其他人找到它。好奇你的重讀比例是多少.

授權

Apache 2.0 — 請參閱倉庫授權