我跟踪了 Claude Code 的 Token 消耗一周。让我感到惊讶的事情。

📄 中文摘要

通过使用名为 TokenBar 的工具,实时跟踪 Claude Code 的 Token 使用情况,作者发现了许多意想不到的开销。尤其是在没有正确清除上下文的情况下,每次开始新的 Claude Code 会话时,系统提示和文件上下文就会消耗 8-12k 个 Token。这种实时的支出监控改变了作者的编码方式,使其更加关注 Token 的使用效率。

📄 English Summary

I Tracked My Claude Code Token Spend for a Week. Here's What Actually Surprised Me.

Using a tool called TokenBar, the author tracked their Claude Code token usage in real time, uncovering unexpected costs. Notably, starting a new Claude Code session without properly clearing the context led to an expenditure of 8-12k tokens just for the system prompt and file context. This real-time spending monitoring changed the author's coding habits, making them more aware of token usage efficiency.

Powered by Cloudflare Workers + Payload CMS + Claude 3.5

数据源: OpenAI, Google AI, DeepMind, AWS ML Blog, HuggingFace 等