Skip to main content

On This Page

Measuring AI ROI: Tracking Claude Code Token Spend vs Git Output

2 min read
Share

These articles are AI-generated summaries. Please check the original sources for full details.

Most of us optimize prompts. Very few of us optimize ROI. Here’s what I found tracking my Claude Code spend.

Akshat Sahu released Codelens AI to bridge the visibility gap between AI token consumption and production-ready code. The tool uses a CLI command to correlate local session files with git commit timestamps to calculate specific cost per commit.

Why This Matters

While engineers often focus on prompt engineering, the actual economic value of AI agents is often obscured by vibe coding where tokens are burned without shipping code. Codelens AI addresses this by providing local, zero-config telemetry that distinguishes between useful output and orphaned sessions, ensuring that LLM costs translate into permanent repository changes.

Key Insights

  • Cost per commit calculation via Claude Code session file analysis (Akshat Sahu, 2026)
  • Line survival metrics to determine how much AI-generated code remains in the repository over time
  • Identification of orphaned sessions where tokens were consumed without resulting in a git commit
  • Local-first data privacy ensuring that sensitive session and git data never leaves the developer’s machine

Working Examples

Run the ROI correlator directly without installation

npx claude-roi

Global installation and execution of the Codelens AI CLI

npm install -g claude-roi
claude-roi

Practical Applications

  • Use case: Engineering managers using Codelens AI to audit AI coding efficiency across repositories. Pitfall: Optimizing solely for prompt length rather than line survival leads to high rework costs.
  • Use case: Individual developers tracking cost per feature using the Codelens dashboard. Pitfall: Ignoring orphaned sessions results in unaccounted token burn without production value.

References:

Continue reading

Next article

Dev Whisper: Implementing Secure P2P Messaging via Chrome Extensions

Related Content