Skip to content
Code Insights
Documentation

Terminal Analytics

View cost breakdowns, model usage, project activity, and today's sessions directly in your terminal with the code-insights stats command suite.

Overview

code-insights stats

Shows a dashboard overview for the last 7 days: session count, messages, tool calls, duration, cost, and an activity chart.

Terminal stats output

Subcommands

Cost breakdown

code-insights stats cost

Cost breakdown by project and model. Shows token usage, cache hits, and USD cost.

Per-project details

code-insights stats projects

Detail cards for each project: session count, duration, character distribution.

Today's sessions

code-insights stats today

All sessions from today with titles and durations.

Model usage

code-insights stats models

Model usage distribution: session count, message count, and cost per model.

Shared flags

All stats subcommands support these flags:

FlagDefaultDescription
--period 7d|30d|90d|all7dTime range
--project <name>Filter to a specific project
--source <tool>Filter by source tool
--no-syncSkip auto-sync before showing stats

Examples

# Cost for the last 30 days
code-insights stats cost --period 30d
 
# Today's sessions for a specific project
code-insights stats today --project my-app
 
# Model usage for Cursor sessions only
code-insights stats models --source cursor