Skip to content

feat: bernstein stats command showing lifetime usage metrics and achievements #751

@chernistry

Description

@chernistry

Description

`bernstein stats` shows your lifetime Bernstein usage — tasks completed, agents spawned, money saved, code merged. Make it fun, shareable, and slightly gamified.

Example output

Your Bernstein Stats
  Since: March 22, 2026 (22 days)
  Total runs: 47
  Tasks completed: 312
  Tasks failed: 18 (94.2% success rate)
  Agents spawned: 891
  Lines of code merged: 48,291
  Total cost: $127.43
  Estimated savings: $489.20 (3.8x ROI)

  Adapters used: claude (67%), codex (21%), gemini (12%)
  Most productive day: April 13 (60 tasks)
  Longest streak: 8 days

  Share: bernstein stats --json | copy to clipboard

Implementation

Files to create

  • `src/bernstein/cli/commands/stats_cmd.py`
  • `src/bernstein/core/observability/usage_stats.py`

Data sources

  • `.sdd/archive/tasks.jsonl` — completed tasks
  • `.sdd/metrics/` — cost data
  • `.sdd/runs/` — run history

Key features

  • Read from existing data (no new telemetry needed)
  • `--json` flag for machine-readable output
  • `--since` flag for time-windowed stats
  • Make the output look good enough to screenshot and tweet

Testing

```bash
uv run pytest tests/unit/test_usage_stats.py -x -q
```

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions