Show HN: CodeBurn – Analyze Claude Code token usage by task
TL;DR Highlight
An open-source tool that visualizes where and how much tokens are consumed in AI coding tools with a terminal dashboard, operating by reading only local session files without the need for separate API keys or proxies.
Who Should Read
Developers who use AI coding tools such as Claude Code, Cursor, and Codex daily and want to understand their costs and identify tasks that consume a lot of tokens.
Core Mechanics
- CodeBurn shows token usage for major AI coding tools like Claude Code, OpenAI Codex, Cursor, OpenCode, Pi, and GitHub Copilot, categorized by task type, tool, model, MCP server, and project.
- Its operation is unique: it doesn't require any wrappers, proxies, or API keys, and directly analyzes session files stored on disk by each tool. Claude Code uses paths like ~/.claude/projects/, and Codex uses ~/.codex/sessions/.
- It tracks the 'one-shot success rate' for each task type, allowing you to see which tasks are completed on the first attempt and which ones waste tokens with edit/test/fix retries.
- It's an interactive TUI (Terminal UI) dashboard that runs in the terminal, built on Ink (a terminal React framework), and supports gradient charts, responsive panels, and keyboard navigation.
- It supports various time ranges such as today, 7 days, 30 days, monthly, and all time, and also features CSV/JSON export, a macOS SwiftBar menu bar widget, and auto-refresh functionality.
- Price information is automatically cached from LiteLLM, allowing you to calculate costs for all supported models without separate configuration.
- Installation is as simple as `npm install -g codeburn`, and you can run it directly with `npx codeburn` if you have Node.js 20+. Cursor/OpenCode automatically install better-sqlite3 to read SQLite files.
- The creator revealed that they were spending about $1,400 per week on Claude Code and wanted to see where the tokens were being consumed.
Evidence
- Regarding the creator's mention of spending $1,400 per week on Claude Code, one comment stated that a $200/month plan was sufficient to run 5 agents simultaneously on a 300k LoC codebase without ever hitting the rate limit, suggesting that a flat-rate plan eliminates cost concerns compared to pay-as-you-go.
- Claudoscope (github.com/cordwainersmith/Claudoscope) and ClaudeRank (clauderank.com) were mentioned in the comments as tools with similar purposes, and commenters expressed a preference for CodeBurn's approach.
- A compatibility issue with Cursor Agent was reported, where the tool fails to recognize data if Cursor stores it in the ~/.cursor path.
- An interesting fact was shared in the comments about the terminal UI being built with Ink (React for terminals), noting that 'Claude Code itself is also made with Ink'.
- A comment suggested adding a feature to detect cost inefficiencies and propose improvements, and the creator responded positively.
How to Apply
- If you use Claude Code or Cursor daily and your bill at the end of the month is higher than expected, you can immediately run `npx codeburn` to see which projects and task types are consuming the most tokens.
- By identifying task types with low one-shot success rates, you can improve the prompts or task decomposition methods to reduce token waste from retries.
- If you're deploying AI coding tools across a team and need to justify costs, you can extract data with `codeburn report --format json` to create team- and project-based cost reports.
- If you're on macOS and want to continuously monitor token usage, you can connect it to a SwiftBar menu bar widget to view the status without opening a separate dashboard.
Code Example
# Installation
npm install -g codeburn
# Run directly without installation
npx codeburn
# Basic interactive dashboard (last 7 days)
codeburn
# Today's usage
codeburn today
# This month's usage
codeburn month
# Recent 30-day rolling window
codeburn report -p 30days
# All time
codeburn report -p all
# Output in JSON format
codeburn report --format json
# Auto-refresh every 60 seconds
codeburn report --refresh 60
# One-line summary (today + this month)
codeburn status
# Export to CSV (today/7 days/30 days)
codeburn export
# Export to JSON
codeburn export -f jsonTerminology
Related Papers
Jamesob's guide to running SOTA LLMs locally
2천 달러짜리 RTX 3090 한 장부터 4만 달러짜리 RTX PRO 6000 4장 셋업까지, 로컬에서 최신 LLM을 직접 돌리는 방법을 하드웨어 선택·구성·실행 설정까지 통째로 정리한 실전 가이드다.
Faster embeddings: how we rebuilt the ONNX path in Manticore
Manticore Search가 기존 SentenceTransformers/Candle 백엔드를 ONNX Runtime으로 교체해 텍스트 임베딩 생성 속도를 평균 14배 향상시켰다. 별도 모델 서비스 없이 DB 내부에서 직접 임베딩을 처리하는 구조에서 INSERT 속도가 곧 임베딩 속도이기 때문에 이 개선은 실질적인 ingest 처리량 향상으로 직결된다.
Asymmetric Quantization: Near-Lossless Retrieval with 97% Storage Reduction
멀티벡터 검색 모델의 문서 벡터를 1비트 이진값으로 압축하고 쿼리 벡터만 int8로 유지하는 비대칭 양자화 기법으로, 스토리지를 97% 줄이면서 검색 품질 손실을 0.61점(NDCG@10 기준)에 그치게 만든 실제 프로덕션 적용 사례다.
Show HN: Bash4LLM+ – A lightweight, dependency-free Bash wrapper for LLM APIs
Python이나 Node.js 없이 순수 Bash만으로 Groq 등 OpenAI 호환 LLM API를 호출할 수 있는 단일 스크립트 도구로, Termux(Android)를 포함한 모든 Unix 환경에서 동작한다.
Wayfinder Router: deterministic routing of queries between local and hosted LLM
프롬프트의 복잡도를 모델 호출 없이 오프라인으로 점수화해서 간단한 쿼리는 로컬 모델로, 어려운 쿼리는 유료 모델로 자동 라우팅하는 CLI 도구다. LLM 비용을 줄이면서도 응답 품질을 유지하고 싶은 개발자에게 유용하다.
Apple Neural Engine: Architecture, Programming, and Performance
Apple 기기에 내장된 AI 전용 칩인 ANE(Apple Neural Engine)를 리버스 엔지니어링으로 분석한 302페이지짜리 기술 문서로, Core ML 아래 숨겨진 내부 구조와 직접 접근 경로를 처음으로 공개한다.