Skip to content

Open source AI coding stats library - Track, analyze, and certify how you use AI coding assistants

License

Notifications You must be signed in to change notification settings

srdanirz/statscode

Repository files navigation

StatsCode

Track your AI coding hours, patterns, and achievements.

License: MIT

🌐 EnglishEspañolPortuguês中文

What is StatsCode?

StatsCode tracks how you use AI coding assistants. Think of it as GitHub stats for AI-assisted coding.

  • Track hours spent coding with AI
  • View insights about your coding patterns
  • Sync to cloud and appear on the leaderboard
  • Add a badge to your GitHub profile

Supported Tools

Tool Status
Claude Code Available
OpenCode Available
Codex Pronto
Antigravity Pronto
Cursor Pronto

Quick Start

Claude Code

# Install via marketplace
claude plugins install statscode

# Or manually
cd ~/.claude/plugins
git clone https://github.com/srdanirz/statscode

Commands

Command Description
/statscode:stats View your coding statistics
/statscode:insights View session patterns
/statscode:login Login with GitHub
/statscode:badge View your earned badges

OpenCode

Add to your opencode.json (docs):

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@statscode/plugin-opencode"]
}

The plugin installs automatically via Bun on startup.

Custom Tools

Tool Description
statscode.stats View your coding statistics
statscode.badge Generate badge SVG
statscode.sync Force sync to cloud

What's Tracked

  • Active Hours - Time spent coding (activity-based)
  • Sessions - Number of sessions
  • Prompts - Total prompts sent
  • Lines Generated - Code written/edited
  • Languages - Programming languages used

Add Badge to GitHub Profile

After logging in with /statscode:login:

[![StatsCode](https://api.statscode.dev/badge/YOUR_USERNAME.svg)](https://statscode.dev/profile/YOUR_USERNAME)

Packages

Package Description
@statscode/core Core tracking library
@statscode/api-client Cloud sync SDK
@statscode/plugin-claude-code Claude Code plugin
@statscode/plugin-opencode OpenCode plugin

Privacy

  • All data stored locally by default (~/.statscode/)
  • Cloud sync is opt-in only
  • No code or prompts uploaded
  • Only aggregated stats synced

Development

git clone https://github.com/srdanirz/statscode
cd statscode
npm install
npm run build

License

MIT

About

Open source AI coding stats library - Track, analyze, and certify how you use AI coding assistants

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •