Check how many hours and dollars you spent coding with Claude Code across all your projects this month.
Get a green/yellow/red burnout readiness score before starting a high-stakes coding session.
Break down your AI API costs by project to see which codebases are consuming the most tokens.
Requires Claude Code to have been used previously so session log files exist on disk.
CodeStrain CLI is a terminal tool that reads the session log files Claude Code stores on your computer and reports how much you have been coding, what it cost, and a rough estimate of how rested or strained you are. It works entirely offline, requires no account, and sends nothing to any server. When you run Claude Code (an AI coding assistant), it writes detailed logs of every session to a folder on your local disk. CodeStrain parses those log files to calculate your total session count, time spent, number of conversation turns, token usage, estimated API cost broken down by project, and which AI models were used. You can view just today's numbers or aggregate everything across all time. The main distinctive feature is the Developer Recovery Score, abbreviated DRS. It estimates how much cognitive strain your recent coding sessions have created and how much you have recovered. Strain is calculated by looking at the gaps between turns in a session: gaps of five minutes or less count as active coding, and each hour of that adds to the strain score. Late-night sessions and weekend work apply a small additional penalty. Recovery is estimated from how long it has been since your last session, used as a rough proxy for sleep. The result is a traffic-light readiness label: green, yellow, or red. The README is explicit that this is a behavioral heuristic from log data, not medical advice. CodeStrain has no external dependencies beyond Python's standard library, which means it installs quickly and works on Python 3.9 and later. You can install it through Homebrew, pipx, or uv. The CLI is MIT-licensed and free to use without any hosted service. A fuller version of the DRS model, incorporating wearable data from Apple Health, WHOOP, or Oura, is described as a separate paid product on the codestrain.dev website. The CLI does not require or connect to that service.
← codestrain on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.