track-my-prompts
v0.1.1
Published
Track your AI coding prompt activity — locally and on the global leaderboard
Maintainers
Readme
track-my-prompts
Strava for AI-assisted coding. Track your prompt activity across AI coding tools, earn milestone badges, and compete on a global leaderboard.
npm install -g track-my-promptsWhat it does
track-my-prompts parses your Claude Code session files, extracts prompt metrics (count, tool calls, subagent calls, duration, velocity), stores everything locally in SQLite, and serves a beautiful dark-themed dashboard. Optionally sync to a global leaderboard where builders compete and inspire each other.
Privacy first: Only metrics are tracked. Prompt content, file paths, and code are never stored or transmitted.
Quick start
# Install globally
npm install -g track-my-prompts
# Navigate to any project that has Claude Code sessions
cd ~/my-project
# Scan your Claude Code sessions
tmp scan
# See your stats
tmp stats
# Launch the web dashboard
tmp dashboardThe dashboard opens at http://localhost:3141 with your project analytics, activity heatmap, and milestone progress.
CLI commands
| Command | Description |
|---|---|
| tmp init | Initialize tracking for the current project |
| tmp scan | Scan Claude Code sessions and import prompt data |
| tmp status | Quick overview of current project status |
| tmp stats | Detailed stats with tables and charts |
| tmp watch | Watch for new prompts in real-time |
| tmp dashboard | Launch the web dashboard on localhost:3141 |
| tmp register | Register for the global leaderboard |
| tmp sync | Sync your stats to the global leaderboard |
| tmp leaderboard | View the global leaderboard in your terminal |
Scanning
# Scan current project
tmp scan
# Output:
# Scanning sessions for: my-project
# Scan complete!
# Sessions scanned: 12
# New prompts: 47
# Total prompts: 203
#
# Achievement unlocked: Building Momentum!
# +47 new prompts recorded. Total: 203. Don't give up too early.The scanner automatically finds Claude Code session files at ~/.claude/projects/<encoded-path>/ and parses the JSONL format to extract:
- Human prompts (filtered from tool results and system messages)
- Tool call counts per response
- Subagent invocations
- Session duration and per-prompt timing
- Model information
Watch mode
tmp watchMonitors your Claude Code sessions in real-time. See your prompt count tick up live, get notified when you hit milestones, and never lose track of your progress.
Global leaderboard
# Register with your username and GitHub handle
tmp register
# Sync your stats (only metrics — never prompt content)
tmp sync
# View the leaderboard
tmp leaderboardYou can also enable auto-sync so your stats are pushed after every scan:
tmp dashboard # Go to Settings > Enable Auto-syncDashboard
Launch with tmp dashboard and open http://localhost:3141.
Home page
- Total prompts, sessions, tool calls across all projects
- GitHub-style activity heatmap showing your daily prompt activity
- Project cards with current badge and progress to next milestone
- Week-over-week trend comparison
Project detail
- Deep stats: prompts per session, average duration, prompt velocity (prompts/hour)
- Badge strip showing earned and upcoming milestones
- Activity heatmap for this project
- Prompts-over-time line chart
- Tool usage breakdown (donut chart)
- Session history with pagination
Leaderboard
- Top builders ranked by total prompts
- Tool-type filter (Claude Code, Cursor)
- Sort by prompts, streak, or sessions
- Search by username
- "That's you!" highlight when you're on the board
Settings
- Profile: username, GitHub handle
- Auto-sync toggle
- Share project names toggle (opt-in)
- Dark mode (enabled by default)
Motivational system
track-my-prompts is built around the idea that most builders give up too early. The motivational system encourages you to push past 300-500 prompts per project — where real results happen.
Milestone badges
| Badge | Threshold | Emoji | |---|---|---| | Getting Started | 50 prompts | :seedling: | | Finding Your Flow | 100 prompts | :ocean: | | Building Momentum | 200 prompts | :rocket: | | Committed Builder | 300 prompts | :hammer: | | Prompt Master | 500 prompts | :star: | | Relentless | 1,000 prompts | :fire: |
Streak badges
| Badge | Threshold | Emoji | |---|---|---| | On a Roll | 3 consecutive days | :dart: | | Week Warrior | 7 consecutive days | :crossed_swords: | | Unstoppable | 14 consecutive days | :muscle: | | Monthly Master | 30 consecutive days | :crown: |
Badges are awarded per-project and announced in the CLI when you scan.
How it works
Architecture
┌──────────────────────┐ ┌─────────────────────┐
│ Claude Code │ │ Global API │
│ ~/.claude/projects │ │ (Hono + Postgres) │
│ *.jsonl files │ │ │
└─────────┬────────────┘ └──────────▲───────────┘
│ parse │ sync (opt-in)
▼ │
┌──────────────────────┐ ┌──────────┴───────────┐
│ CLI (tmp) │────▶│ Local API Server │
│ scan/stats/watch │ │ Express :3141 │
│ SQLite storage │ │ + React Dashboard │
└──────────────────────┘ └──────────────────────┘- CLI: Node.js CLI built with Commander. Parses Claude Code JSONL session files using streaming readline.
- Local storage: SQLite via better-sqlite3. Stores projects, sessions, individual prompts, daily stats, and milestones. Located at
~/.track-my-prompts/data.db. - Dashboard: React 18 + Vite + Tailwind CSS. Dark theme with Inter + JetBrains Mono fonts. Bundled into the CLI package as static files.
- Local API: Express server on port 3141. Serves the dashboard and provides REST endpoints for all local data.
- Global API: Hono + Neon Postgres. Hosted separately. Receives anonymized metrics via sync, serves the leaderboard.
What gets tracked
Per prompt:
- Timestamp
- Duration (ms)
- Tool calls triggered
- Subagent calls triggered
- Model used
Per session:
- Start/end time
- Total duration
- Prompt count
- Tool call count
- Subagent count
Per project (aggregated):
- Total prompts, sessions, tool calls, subagent calls
- Daily activity (for heatmap and streaks)
- Milestone achievements
- Prompt velocity (prompts per hour)
What is NEVER tracked
- Prompt content (what you typed)
- AI response content
- File paths or code
- Project directory paths (only project name, and only if you opt in to sharing)
Configuration
Config is stored at ~/.track-my-prompts/config.json:
{
"token": null,
"username": null,
"githubHandle": null,
"globalApiUrl": "https://track-my-prompts.vercel.app",
"autoSync": false,
"shareProjectNames": false
}| Field | Description |
|---|---|
| token | Auth token for global leaderboard (set via tmp register) |
| username | Your display name on the leaderboard |
| githubHandle | Your GitHub username (shown on leaderboard) |
| globalApiUrl | URL of the global API server |
| autoSync | Automatically sync after each scan |
| shareProjectNames | Include project names in sync data (default: false) |
Development
Prerequisites
- Node.js >= 18
- npm
Setup
git clone https://github.com/the-wise-agents/track-my-prompts.git
cd track-my-prompts
npm installProject structure
packages/
cli/ # CLI + local API server (npm package)
dashboard/ # React web dashboard
server/ # Global leaderboard API (Hono + Neon)
tests/
unit/ # Unit tests (vitest)
integration/ # API integration tests
e2e/ # E2E tests (Playwright)Build
# Build dashboard
cd packages/dashboard && npm run build
# Build CLI
cd packages/cli && npx tsup
# Or build both (CLI prebuild script builds dashboard first)
cd packages/cli && npm run buildTest
# Run all tests from project root
npx vitest run
# 129 tests across 23 filesLocal development
# Build dashboard
cd packages/dashboard && npm run build
# Run CLI commands directly
cd packages/cli && node dist/index.js scan
cd packages/cli && node dist/index.js dashboardSupported AI tools
| Tool | Status | How it works |
|---|---|---|
| Claude Code | Supported | Parses JSONL session files from ~/.claude/projects/ |
| Cursor | Planned (v2) | TBD |
Global API
The global API server handles registration, sync, and leaderboard queries. It's built with Hono and uses Neon Postgres for storage.
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /api/register | Register a new user |
| POST | /api/sync | Sync project metrics |
| GET | /api/leaderboard | Get leaderboard entries |
| GET | /api/me | Get your own stats |
Self-hosting
The global API is designed to run on Vercel with a Neon Postgres database. To self-host:
- Create a Neon Postgres database
- Set
DATABASE_URLin your environment - Deploy
packages/server/to Vercel (or any Node.js host) - Update
globalApiUrlin your local config
Requirements
- Node.js >= 18.0.0
- macOS, Linux, or Windows
- Claude Code installed (for session data)
License
MIT
