메뉴
HN
Hacker News 47일 전

CodeBurn: 코딩 AI 토큰 사용량 분석 도구

IMP
7/10
핵심 요약

CodeBurn은 Claude Code, Cursor, GitHub Copilot 등 다양한 AI 코딩 도구의 토큰 사용량과 비용을 작업 유형, 도구, 모델별로 분석해 주는 도구입니다. 디스크의 세션 데이터를 직접 읽어 프록시나 API 키 없이도 작동하며, 원샷 성공률 추적, 인터랙티브 대시보드, CSV/JSON 내보내기 등을 지원합니다. 프로바이더 플러그인 시스템을 통해 새로운 AI 코딩 도구도 쉽게 추가할 수 있습니다.

번역된 본문

CodeBurn – 당신의 AI 코딩 토큰이 어디에 쓰이는지 확인하세요. 작업 유형, 도구, 모델, MCP 서버, 프로젝트별로 분석해 줍니다. Claude Code, Codex(OpenAI), Cursor, OpenCode, Pi, GitHub Copilot을 지원하며 프로바이더 플러그인 시스템을 갖추고 있습니다.

활동 유형별 원샷 성공률을 추적하여, AI가 첫 시도에 성공하는 경우와 편집/테스트/수정 재시도로 토큰을 소모하는 경우를 구분해서 볼 수 있습니다. 그라디언트 차트, 반응형 패널, 키보드 내비게이션이 포함된 인터랙티브 TUI 대시보드를 제공합니다. SwiftBar를 통한 macOS 메뉴 막대 위젯, CSV/JSON 내보내기를 지원합니다.

디스크에서 세션 데이터를 직접 읽어서 작동합니다. 래퍼(wrapper), 프록시, API 키가 필요 없습니다. 가격 책정은 LiteLLM 기반입니다(자동 캐시 적용, 모든 모델 지원).

설치: npm install -g codeburn 설치 없이 실행: npx codeburn

요구 사항: Node.js 20 이상 지원 도구별 데이터 위치:

  • Claude Code: ~/.claude/projects/
  • Codex: ~/.codex/sessions/
  • Cursor, OpenCode, Pi: ~/.pi/agent/sessions/
  • GitHub Copilot: ~/.copilot/session-state/

Cursor/OpenCode 지원을 위해 better-sqlite3가 선택적 의존성으로 자동 설치됩니다.

사용법: codeburn # 인터랙티브 대시보드 (기본: 7일) codeburn today # 오늘 사용량 codeburn month # 이번 달 사용량 codeburn report -p 30days # 최근 30일 codeburn report -p all # 모든 기록된 세션 codeburn report --refresh 60 # 60초마다 자동 새로고침 codeburn status # 간략 한 줄 요약 (오늘 + 이번 달) codeburn status --format json codeburn export # CSV 내보내기 (오늘, 7일, 30일) codeburn export -f json # JSON 내보내기

방향키로 Today / 7 Days / 30 Days / Month / All Time 전환. q로 종료, 1~5 숫자키로 단축 접근. 대시보드는 세션당 평균 비용과 모든 프로젝트 중 가장 비용이 높은 세션 5개도 표시합니다.

프로바이더: CodeBurn은 사용 중인 AI 코딩 도구를 자동 감지합니다. 여러 프로바이더의 세션 데이터가 디스크에 있으면 대시보드에서 p 키로 전환할 수 있습니다.

codeburn report # 모든 프로바이더 통합 (기본값) codeburn report --provider claude # Claude Code만 codeburn report --provider codex # Codex만 codeburn report --provider cursor # Cursor만 codeburn report --provider opencode # OpenCode만 codeburn report --provider pi # Pi만 codeburn report --provider copilot # GitHub Copilot만 codeburn today --provider codex # Codex 오늘 사용량 codeburn export --provider claude # Claude 데이터만 내보내기

--provider 플래그는 report, today, month, status, export 모든 명령에 사용 가능합니다.

지원 프로바이더:

  • Claude Code (~/.claude/projects/) – 지원됨
  • Claude Desktop (~/Library/Application Support/Claude/local-agent-mode-sessions/) – 지원됨
  • Codex OpenAI (~/.codex/sessions/) – 지원됨
  • Cursor (~/Library/Application Support/Cursor/User/globalStorage/state.vscdb) – 지원됨
  • OpenCode (~/.local/share/opencode/, SQLite) – 지원됨
  • Pi (~/.pi/agent/sessions/) – 지원됨
  • GitHub Copilot (~/.copilot/session-state/) – 지원됨 (출력 토큰만)
  • Amp – 계획 중 (프로바이더 플러그인 시스템)

Codex 도구 이름은 Claude 규칙에 맞게 정규화됩니다(exec_command → Bash, read_file → Read 등). 활동 분류기와 도구 분석이 프로바이더 간에 일관되게 작동합니다.

Cursor는 로컬 SQLite 데이터베이스에서 토큰 사용량을 읽습니다. Cursor의 "Auto" 모드는 실제 사용된 모델을 숨기므로, 비용은 Sonnet 가격으로 추정되며 대시보드에 "Auto (Sonnet est.)"로 표시됩니다. Cursor 뷰는 개별 도구 호출을 기록하지 않아 Core Tools/Shell/MCP 패널 대신 언어 패널(코드 블록에서 추출)을 표시합니다. 대용량 Cursor 데이터베이스의 첫 실행은 최대 1분이 걸릴 수 있으며, 이후 결과는 캐시되어 즉시 표시됩니다.

GitHub Copilot은 세션 상태에 출력 토큰만 기록하므로 Copilot 비용 행은 실제 API 비용보다 낮게 책정됩니다. 모델은 session.model_change 이벤트로 추적되며, 첫 모델 변경 전 메시지는 잘못된 귀속을 피하기 위해 건너뜁니다.

프로바이더 추가: 프로바이더 플러그인 시스템으로 새 프로바이더 추가는 단일 파일로 가능합니다. 각 프로바이더는 세션 발견, JSONL 파싱, 도구 정규화, 모델 표시 이름을 구현합니다.

원문 보기
원문 보기 (영어)
CodeBurn See where your AI coding tokens go. By task type, tool, model, MCP server, and project. Supports Claude Code , Codex (OpenAI), Cursor , OpenCode , Pi , and GitHub Copilot with a provider plugin system. Tracks one-shot success rate per activity type so you can see where the AI nails it first try vs. burns tokens on edit/test/fix retries. Interactive TUI dashboard with gradient charts, responsive panels, and keyboard navigation. macOS menu bar widget via SwiftBar. CSV/JSON export. Works by reading session data directly from disk. No wrapper, no proxy, no API keys. Pricing from LiteLLM (auto-cached, all models supported). Install npm install -g codeburn Or run without installing: npx codeburn Requirements Node.js 20+ Claude Code ( ~/.claude/projects/ ), Codex ( ~/.codex/sessions/ ), Cursor, OpenCode, Pi ( ~/.pi/agent/sessions/ ), and/or GitHub Copilot ( ~/.copilot/session-state/ ) For Cursor/OpenCode support: better-sqlite3 is installed automatically as an optional dependency Usage codeburn # interactive dashboard (default: 7 days) codeburn today # today's usage codeburn month # this month's usage codeburn report -p 30days # rolling 30-day window codeburn report -p all # every recorded session codeburn report --refresh 60 # auto-refresh every 60 seconds codeburn status # compact one-liner (today + month) codeburn status --format json codeburn export # CSV with today, 7 days, 30 days codeburn export -f json # JSON export Arrow keys switch between Today / 7 Days / 30 Days / Month / All Time. Press q to quit, 1 2 3 4 5 as shortcuts. The dashboard also shows average cost per session and the five most expensive sessions across all projects. Providers CodeBurn auto-detects which AI coding tools you use. If multiple providers have session data on disk, press p in the dashboard to toggle between them. codeburn report # all providers combined (default) codeburn report --provider claude # Claude Code only codeburn report --provider codex # Codex only codeburn report --provider cursor # Cursor only codeburn report --provider opencode # OpenCode only codeburn report --provider pi # Pi only codeburn report --provider copilot # GitHub Copilot only codeburn today --provider codex # Codex today codeburn export --provider claude # export Claude data only The --provider flag works on all commands: report , today , month , status , export . Supported providers Provider Data location Status Claude Code ~/.claude/projects/ Supported Claude Desktop ~/Library/Application Support/Claude/local-agent-mode-sessions/ Supported Codex (OpenAI) ~/.codex/sessions/ Supported Cursor ~/Library/Application Support/Cursor/User/globalStorage/state.vscdb Supported OpenCode ~/.local/share/opencode/ (SQLite) Supported Pi ~/.pi/agent/sessions/ Supported GitHub Copilot ~/.copilot/session-state/ Supported (output tokens only) Amp -- Planned (provider plugin system) Codex tool names are normalized to match Claude's conventions ( exec_command shows as Bash , read_file as Read , etc.) so the activity classifier and tool breakdown work across providers. Cursor reads token usage from its local SQLite database. Since Cursor's "Auto" mode hides the actual model used, costs are estimated using Sonnet pricing (labeled "Auto (Sonnet est.)" in the dashboard). The Cursor view shows a Languages panel (extracted from code blocks) instead of Core Tools/Shell/MCP panels, since Cursor does not log individual tool calls. First run on a large Cursor database may take up to a minute; results are cached and subsequent runs are instant. GitHub Copilot only logs output tokens in its session state, so Copilot cost rows sit below actual API cost. The model is tracked via session.model_change events; messages before the first model change are skipped to avoid silent misattribution. Adding a provider The provider plugin system makes adding a new provider a single file. Each provider implements session discovery, JSONL parsing, tool normalization, and model display names. See src/providers/codex.ts for an example. Currency By default, costs are shown in USD. To display in a different currency: codeburn currency GBP # set to British Pounds codeburn currency AUD # set to Australian Dollars codeburn currency JPY # set to Japanese Yen codeburn currency # show current setting codeburn currency --reset # back to USD Any ISO 4217 currency code is supported (162 currencies). Exchange rates are fetched from Frankfurter (European Central Bank data, free, no API key) and cached for 24 hours at ~/.cache/codeburn/ . Config is stored at ~/.config/codeburn/config.json . The currency setting applies everywhere: dashboard, status bar, menu bar widget, CSV/JSON exports, and JSON API output. The menu bar widget includes a currency picker with 17 common currencies. For any currency not listed, use the CLI command above. Menu Bar codeburn install-menubar # install SwiftBar/xbar plugin codeburn uninstall-menubar # remove it Requires SwiftBar ( brew install --cask swiftbar ). Shows today's cost in the menu bar with a flame icon. Dropdown shows activity breakdown, model costs, token stats, per-provider cost breakdown, and a currency picker. Refreshes every 5 minutes. What it tracks 13 task categories classified from tool usage patterns and user message keywords. No LLM calls, fully deterministic. Category What triggers it Coding Edit, Write tools Debugging Error/fix keywords + tool usage Feature Dev "add", "create", "implement" keywords Refactoring "refactor", "rename", "simplify" Testing pytest, vitest, jest in Bash Exploration Read, Grep, WebSearch without edits Planning EnterPlanMode, TaskCreate tools Delegation Agent tool spawns Git Ops git push/commit/merge in Bash Build/Deploy npm build, docker, pm2 Brainstorming "brainstorm", "what if", "design" Conversation No tools, pure text exchange General Skill tool, uncategorized Breakdowns : daily cost chart, per-project, per-model (Opus/Sonnet/Haiku/GPT-5/GPT-4o/Gemini), per-activity with one-shot rate, core tools, shell commands, MCP servers. One-shot rate : For categories that involve code edits, CodeBurn detects edit/test/fix retry cycles (Edit -> Bash -> Edit patterns). The 1-shot column shows the percentage of edit turns that succeeded without retries. Coding at 90% means the AI got it right first try 9 out of 10 times. Pricing : Fetched from LiteLLM model prices (auto-cached 24h at ~/.cache/codeburn/ ). Handles input, output, cache write, cache read, and web search costs. Fast mode multiplier for Claude. Hardcoded fallbacks for all Claude and GPT-5 models to prevent fuzzy matching mispricing. Reading the dashboard CodeBurn surfaces the data, you read the story. A few patterns worth knowing: Signal you see What it might mean Cache hit < 80% System prompt or context isn't stable, or caching not enabled Lots of Read calls per session Agent re-reading same files, missing context Low 1-shot rate (Coding 30%) Agent struggling with edits, retry loops Opus 4.6 dominating cost on small turns Overpowered model for simple tasks dispatch_agent / task heavy Sub-agent fan-out, expected or excessive No MCP usage shown Either you don't use MCP servers, or your config is broken Bash dominated by git status , ls Agent exploring instead of executing Conversation category dominant Agent talking instead of doing These are starting points, not verdicts. A 60% cache hit on a single experimental session is fine. A persistent 60% cache hit across weeks of work is a config issue. How it reads data Claude Code stores session transcripts as JSONL at ~/.claude/projects/<sanitized-path>/<session-id>.jsonl . Each assistant entry contains model name, token usage (input, output, cache read, cache write), tool_use blocks, and timestamps. Codex stores sessions at ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl with token_count events containing per-call and cumulative token usage, and function_call entries for tool tracking. Cursor stores session data in a SQLite database at ~/Library/Application Support/Cursor/User/gl