Efficiency
Efficiency reporting is the core value proposition of llm-usage-metrics. By correlating local Git outcomes with LLM costs, you can derive the true ROI of your AI-assisted development workflow.
The ROI Equation
Section titled “The ROI Equation”llm-usage efficiency joins two high-signal datasets:
- Repo-Attributed Usage: Token counts and costs mapped to your project root.
- Git Outcomes: Local commit volume and line-delta metrics for your author.
This join allows you to answer questions like: How much does a commit actually cost in tokens? and What is my USD spend per 1k lines of code?
Command structure
Section titled “Command structure”llm-usage efficiency <daily|weekly|monthly> [options]Examples:
llm-usage efficiency dailyllm-usage efficiency weekly --repo-dir /path/to/repollm-usage efficiency monthly --repo-dir /path/to/repo --jsonllm-usage efficiency monthly --repo-dir /path/to/repo --source codexWhat is joined
Section titled “What is joined”Efficiency rows are built from two datasets per period:
- repo-attributed usage totals (
Input,Output,Reasoning,Cache Read,Cache Write,Total,Cost) - Git outcomes for your configured author (
Commits,+Lines,-Lines,ΔLines)
Only usage events mapped to the selected repository root are included.
Column formulas
Section titled “Column formulas”All Tokens/Commit=Total / CommitsNon-Cache/Commit=(Input + Output + Reasoning) / Commits$/Commit=Cost / Commits$/1k Lines=Cost / (ΔLines / 1000)Commits/$=Commits / Cost(only whenCost > 0)
Rendering rules:
- period rows are emitted only when both Git outcomes and repo-attributed usage signal exist
- if a denominator is zero, the derived value is
-(terminal/markdown) or omitted in JSON - when pricing is incomplete, affected USD values are approximate (
~prefix in terminal/markdown)
Scope and attribution semantics
Section titled “Scope and attribution semantics”Repository root
Section titled “Repository root”- default repo is current working directory
- override with
--repo-dir - usage events that cannot be mapped to a repo are counted as unattributed and excluded
Filters
Section titled “Filters”Usage filters apply before efficiency aggregation:
--source--provider--model- source path overrides (
--pi-dir,--codex-dir,--gemini-dir,--droid-dir,--opencode-db,--source-dir)
Important: these filters also affect commit attribution. Only commit days with matching repo-attributed usage events are counted in efficiency outcomes.
Reading results without being misled
Section titled “Reading results without being misled”All Tokens/Commitincludes cache read/write tokens by design.Non-Cache/Commitis the cleaner metric for direct prompt/response intensity.- Compare both together:
- high
All Tokens/Commit+ much lowerNon-Cache/Commitusually means cache-heavy traffic - both high means high non-cache workload
- high
For source comparisons, run the same command per source:
llm-usage efficiency monthly --repo-dir /path/to/repo --source pillm-usage efficiency monthly --repo-dir /path/to/repo --source codexllm-usage efficiency monthly --repo-dir /path/to/repo --source geminillm-usage efficiency monthly --repo-dir /path/to/repo --source droidllm-usage efficiency monthly --repo-dir /path/to/repo --source opencodeRecommended review workflow
Section titled “Recommended review workflow”- Start with monthly for stability.
- Check
Commits,ΔLines, andCostfirst (raw denominators). - Then interpret derived ratios (
$/Commit,$/1k Lines, token/commit metrics). - Drill into source/provider/model filters only after baseline sanity checks.