Skip to main content

Overview

The stats command provides comprehensive analytics:
  • Token usage - Input/output tokens per tool, model, and project
  • AI code attribution - Percentage of code written by AI vs human
  • Productivity metrics - Commits per day, lines per day, active days
  • Cost tracking - Estimated costs for API usage
  • Daily trends - 14-day session and token activity
oobo stats                         # Global stats
oobo stats --agent                  # JSON output
oobo stats --project myapp          # Per-project
oobo stats --tool cursor            # Per-tool
oobo stats --since 30d              # Last 30 days

Command Syntax

oobo stats [OPTIONS]
--project
string
Filter by project name, slug, or path.
--tool
string
Filter by tool: cursor, claude, gemini, windsurf, aider, copilot, zed, trae, codex, opencode.
--since
string
Show stats since this date or duration. Examples: 7d, 30d, 2w, 3m, 2026-02-01.
--agent
boolean
default:"false"
Output as JSON.

Examples

Global stats

oobo stats
Launches an interactive TUI showing:
  • Total sessions and tokens
  • Per-tool breakdown
  • Top projects
  • Daily activity (last 14 days)
  • AI code percentage
  • Productivity summary

Per-project stats

oobo stats --project myapp

Per-tool stats

oobo stats --tool cursor

Time-filtered stats

oobo stats --since 30d              # Last 30 days
oobo stats --since 2w               # Last 2 weeks
oobo stats --since 3m               # Last 3 months
oobo stats --since 2026-02-01       # Since a specific date

JSON output for agents

oobo stats --agent

Output Fields

Summary Metrics

FieldTypeDescription
scopeobjectFilter scope (project, tool)
sessionsnumberTotal session count
input_tokensnumberTotal input tokens
output_tokensnumberTotal output tokens
total_tokensnumberSum of input + output
total_cost_usdnumberEstimated cost in USD
total_duration_secsnumberTotal session duration

API Usage

Remote API usage from tool providers (last 30 days):
FieldTypeDescription
input_tokensnumberInput tokens from API
output_tokensnumberOutput tokens from API
cache_read_tokensnumberPrompt cache reads (Anthropic)
cost_usdnumberActual cost from API
daysnumberNumber of days covered

Per-Tool Breakdown

FieldTypeDescription
toolstringTool name
sessionsnumberSessions for this tool
input_tokensnumberInput tokens
output_tokensnumberOutput tokens
cost_usdnumberEstimated cost

Per-Model Breakdown

FieldTypeDescription
modelstringModel identifier
sessionsnumberSessions using this model
input_tokensnumberInput tokens
output_tokensnumberOutput tokens
cost_usdnumberEstimated cost
pct_of_totalnumberPercentage of total output tokens

AI Code Attribution

FieldTypeDescription
total_commitsnumberTotal commits tracked
total_linesnumberTotal lines changed
ai_linesnumberLines written by AI
human_linesnumberLines written by human
ai_percentagenumberPercentage of code written by AI (0-100)

Productivity Metrics

FieldTypeDescription
active_daysnumberDays with at least one commit
total_commitsnumberTotal commits
lines_addednumberTotal lines added
lines_deletednumberTotal lines deleted
commits_per_daynumberAverage commits per active day
lines_per_daynumberAverage lines per active day

Daily Stats

FieldTypeDescription
datestringDate (YYYY-MM-DD)
sessionsnumberSessions on this day
input_tokensnumberInput tokens
output_tokensnumberOutput tokens
cost_usdnumberEstimated cost

Data Sources

Token accuracy varies by tool:
ToolToken SourceCost Accuracy
Claude CodeNative telemetryExact
Codex CLINative telemetryExact
OpenCodeNative telemetryExact
Gemini CLINative telemetryEstimated
AiderNative telemetryExact
ZedNative telemetryExact
CursorEstimated (tiktoken)Estimated
CopilotDiscovery onlyN/A
WindsurfDiscovery onlyN/A
TraeDiscovery onlyPartial
Native telemetry sources provide exact token counts from the tool’s own logs. Estimated sources use tiktoken for approximation.

Interactive TUI

The TUI (launched without --agent) shows:
  1. Summary - Sessions, tokens, cost, duration
  2. Per-Tool - Breakdown by AI tool
  3. Top Projects - Top 10 projects by token usage
  4. Daily Activity - Last 14 days of sessions and tokens
  5. AI Code % - Percentage of code written by AI
  6. Productivity - Commits/day, lines/day, active days
  7. Per-Model - Breakdown by AI model

Use Cases

Track monthly token usage

oobo stats --since 30d

Compare tools

oobo stats --agent | jq '.per_tool'

Find your most active project

oobo stats --agent | jq '.per_tool | sort_by(.sessions) | reverse | .[0]'

Calculate AI code percentage

oobo stats --agent | jq '.ai_code.ai_percentage'

Export stats for reporting

oobo stats --agent > stats.json

See cost per project

oobo stats --project myapp --agent | jq '.total_cost_usd'

Time Filters

The --since flag accepts:
  • Relative durations: 7d, 30d, 2w, 3m
    • d = days
    • w = weeks (7 days)
    • m = months (30 days)
  • Absolute dates: 2026-02-01, 2026-01-15
oobo stats --since 7d       # Last 7 days
oobo stats --since 2w       # Last 14 days
oobo stats --since 3m       # Last 90 days
oobo stats --since 2026-02-01  # Since Feb 1, 2026

Plain Text Output

When stdout is not a terminal (e.g., piped or redirected), stats outputs plain text instead of the TUI:
oobo stats | cat
Output:
oobo stats — all projects
Sessions:       42
Input tokens:   125k
Output tokens:  84k
Total tokens:   209k
Total time:     2h 0m

  Cursor         25 sessions    75k in    50k out
  Claude         17 sessions    50k in    34k out

Next Steps

Sessions

Explore individual AI chat sessions

Anchors

See AI code attribution per commit

Build docs developers (and LLMs) love