bashstats 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NUL ADDED
File without changes
package/README.md CHANGED
@@ -1,9 +1,10 @@
1
1
  # bashstats
2
- <img width="1727" height="916" alt="bashstats2" src="https://github.com/user-attachments/assets/4029e711-f559-4771-9490-dedd4aeec1ee" />
2
+ <img alt="bashstats dashboard" src="docs/dashboard.png" />
3
3
 
4
- Track every prompt, tool call, and late-night coding session. Earn badges. Build streaks. Watch your rank climb from Bronze to Obsidian.
5
- bashstats hooks into Claude Code and quietly records everything — sessions, prompts, tool usage, errors, and streaks. It then turns it all into stats,
6
- achievements, and a dashboard you'll check way too often.
4
+ Track every prompt, tool call, and late-night coding session. Earn badges. Build streaks. Climb 500 ranks from Bronze to System Anomaly.
5
+
6
+ bashstats hooks into Claude Code and quietly records everything — sessions, prompts, tool usage, errors, tokens, and streaks. It turns all of it into stats,
7
+ 124 achievements, weekly goals, and a dashboard you'll check way too often.
7
8
 
8
9
  ## Install
9
10
 
@@ -40,7 +41,7 @@ The browser dashboard at `http://localhost:17900` includes:
40
41
 
41
42
  - **Overview** - Recent badges, rank progress, stat cards, activity heatmap, and recent sessions at a glance
42
43
  - **Stats** - Lifetime totals, tool breakdowns, time analysis, session records, and project stats in a 2x2 grid
43
- - **Achievements** - All 53 badges with tier progress, organized by category
44
+ - **Achievements** - All 124 badges with tier progress, organized by category
44
45
  - **Timeline** - Activity heatmap and session history with sparkline charts
45
46
 
46
47
  ## What Gets Tracked
@@ -65,16 +66,16 @@ bashstats hooks into 12 Claude Code events:
65
66
  ## Achievements
66
67
  <img width="1732" height="917" alt="bashstats" src="https://github.com/user-attachments/assets/63591b76-54ff-4659-b81a-e6310810e364" />
67
68
 
68
- 53 badges across 10 categories, each with 5 tiers: Bronze, Silver, Gold, Diamond, Obsidian.
69
+ 124 badges across 16 categories, each with 5 tiers: Bronze, Silver, Gold, Diamond, Singularity. Tiers are calibrated for year-long progression — Bronze in your first week, Singularity after 12+ months.
69
70
 
70
- ### Volume
71
+ ### Volume (5)
71
72
  - **First Prompt** - Submit prompts to Claude
72
73
  - **Tool Time** - Make tool calls
73
74
  - **Marathon** - Spend hours in sessions
74
75
  - **Wordsmith** - Type characters in prompts
75
76
  - **Session Vet** - Complete sessions
76
77
 
77
- ### Tool Mastery
78
+ ### Tool Mastery (7)
78
79
  - **Shell Lord** - Execute Bash commands
79
80
  - **Bookworm** - Read files
80
81
  - **Editor-in-Chief** - Edit files
@@ -83,83 +84,195 @@ bashstats hooks into 12 Claude Code events:
83
84
  - **Web Crawler** - Fetch web pages
84
85
  - **Delegator** - Spawn subagents
85
86
 
86
- ### Time & Streaks
87
+ ### Time & Patterns (10)
87
88
  - **Iron Streak** - Maintain a daily streak
88
89
  - **Night Owl** - Prompts between midnight and 5am
89
90
  - **Early Bird** - Prompts between 5am and 8am
90
91
  - **Weekend Warrior** - Weekend sessions
91
-
92
- ### Behavioral
92
+ - **Witching Hour** - Prompts between 2am and 4am
93
+ - **Lunch Break Coder** - Sessions during lunch hour
94
+ - **Monday Motivation** - Monday sessions
95
+ - **Friday Shipper** - Git commits on Friday
96
+ - **Timezone Traveler** - Unique hours with activity in a day
97
+ - **Seasonal Coder** - Code through all four seasons
98
+
99
+ ### Session Behavior (6)
100
+ - **One More Thing** - Extended sessions (1hr+, 15+ prompts)
101
+ - **Quick Draw** - Sessions under 2 minutes with tool use
102
+ - **The Pivot** - Sessions using 5+ distinct tool types
103
+ - **Context Crunch** - Context compaction events
104
+ - **Permission Slip** - Permission request events
105
+ - **The Returner** - Days with 5+ sessions on the same project
106
+
107
+ ### Behavioral (5)
93
108
  - **Creature of Habit** - Repeat your most-used prompt
94
109
  - **Explorer** - Use unique tool types
95
110
  - **Planner** - Use plan mode
96
111
  - **Novelist** - Write prompts over 1000 characters
97
112
  - **Speed Demon** - Complete sessions in under 5 minutes
98
113
 
99
- ### Resilience
114
+ ### Prompt Patterns (6)
115
+ - **Minimalist** - Short prompts (under 10 words)
116
+ - **Question Master** - Prompts ending with a question mark
117
+ - **The Apologizer** - Prompts containing "sorry"
118
+ - **CAPS LOCK ENERGY** - Fully uppercase prompts
119
+ - **Emoji Whisperer** - Prompts with emoji
120
+ - **Code Dump** - Prompts with 50+ lines
121
+
122
+ ### Resilience (3)
100
123
  - **Clean Hands** - Longest error-free tool streak
101
124
  - **Resilient** - Survive errors
102
125
  - **Rate Limited** - Hit rate limits
103
126
 
104
- ### Shipping & Projects
127
+ ### Error & Recovery (5)
128
+ - **Rubber Duck** - Tool failure followed by success without edits
129
+ - **Third Time's the Charm** - Success after 2+ consecutive failures
130
+ - **The Undoer** - Back-to-back edits on the same file
131
+ - **Crash Test Dummy** - Sessions with 10+ errors
132
+ - **Phoenix** - Total lifetime errors survived
133
+
134
+ ### Tool Combos (5)
135
+ - **Read-Edit-Run** - Read, Edit, Bash sequences
136
+ - **Grep Ninja** - Total Grep and Glob searches
137
+ - **File Factory** - Max files created in a session
138
+ - **The Refactorer** - Max edits to a single file across all sessions
139
+ - **Search and Destroy** - Grep/Glob followed by Edit
140
+
141
+ ### Shipping & Projects (4)
105
142
  - **Shipper** - Make commits via Claude
106
143
  - **PR Machine** - Create pull requests
107
144
  - **Empire** - Work on unique projects
108
145
  - **Polyglot** - Use different programming languages
109
146
 
110
- ### Multi-Agent
147
+ ### Project Dedication (5)
148
+ - **Monogamous** - Max sessions on a single project
149
+ - **Project Hopper** - Max unique projects in a day
150
+ - **The Finisher** - Projects with commits followed by inactivity
151
+ - **Legacy Code** - Return to a project after 30+ days
152
+ - **Greenfield** - Total unique projects initialized
153
+
154
+ ### Multi-Agent (12)
111
155
  - **Buddy System** - Use concurrent agents
112
- - **Hive Mind** - Spawn subagents total
113
-
114
- ### Humor
115
- - **Please and Thank You** - "You're polite to the AI. When they take over, you'll be spared."
116
- - **Wall of Text** - "Claude read your entire novel and didn't even complain."
117
- - **The Fixer** - "At this point just rewrite the whole thing."
118
- - **What Day Is It?** - "Your chair is now a part of you."
119
- - **Copy Pasta** - "Maybe if I ask again it'll work differently."
120
- - **Error Magnet** - "At this point, the errors are a feature."
121
-
122
- ### Aspirational (Obsidian-only)
123
- - **The Machine** - "You are no longer using the tool. You are the tool."
124
- - **Year of Code** - "365 days. No breaks. Absolute unit."
125
- - **Million Words** - "You've written more to Claude than most people write in a lifetime."
126
- - **Lifer** - "At this point, Claude is your cofounder."
127
- - **Transcendent** - "You've reached the peak. The view is nice up here."
128
- - **Omniscient** - "You've mastered every tool. There is nothing left to teach you."
156
+ - **Hive Mind** - Total subagent spawns
157
+ - **Swarm Intelligence** - Max concurrent subagents
158
+ - **Micromanager** - Subagents stopped within 30 seconds
159
+ - **The Orchestrator** - Total subagent spawns across all sessions
160
+ - **Agent Smith** - Max subagents in a single session
161
+ - **Polyglot Agent** - Use multiple CLI agents
162
+ - **Gemini Whisperer** - Complete sessions in Gemini CLI
163
+ - **Copilot Rider** - Complete sessions in Copilot CLI
164
+ - **Open Source Spirit** - Complete sessions in OpenCode
165
+ - **Agent Hopper** - Use different agents on multiple days
166
+ - **Double Agent** - Use 2+ agents on the same day
167
+
168
+ ### Wild Card (12)
169
+ - **Please and Thank You** - Polite prompts
170
+ - **Wall of Text** - Prompts over 5,000 characters
171
+ - **The Fixer** - Max edits to a single file
172
+ - **What Day Is It?** - Sessions exceeding 8 hours
173
+ - **Copy Pasta** - Duplicate prompts submitted
174
+ - **Error Magnet** - Max errors in a single session
175
+ - **D&eacute;j&agrave; Vu** - Same prompt submitted twice within 5 minutes
176
+ - **Trust Issues** - Read immediately after Write on the same file
177
+ - **Backseat Driver** - Prompts with numbered step-by-step instructions
178
+ - **The Negotiator** - Prompts containing "try again" or "one more time"
179
+ - **Rubber Stamp** - Max consecutive permission requests
180
+ - **It Works On My Machine** - Bash success after a previous Bash failure
181
+
182
+ ### Token Usage (10)
183
+ - **Token Burner** - Total tokens consumed across all sessions
184
+ - **Output Machine** - Total output tokens generated
185
+ - **Cache Royalty** - Total cache read tokens
186
+ - **Context Crafter** - Total cache creation tokens
187
+ - **Token Whale** - Most tokens in a single session
188
+ - **Heavy Hitter** - Sessions exceeding 1M total tokens
189
+ - **Featherweight** - Lean sessions under 50K tokens with tool use
190
+ - **Token Velocity** - Average tokens per session
191
+ - **Prolific** - Most output tokens in one session
192
+ - **Input Flood** - Total raw input tokens
193
+
194
+ ### Aspirational (Singularity-only) (12)
195
+ - **The Machine** - 100,000 total tool calls
196
+ - **Year of Code** - 365-day consecutive streak
197
+ - **Million Words** - 10 million characters typed
198
+ - **Lifer** - 10,000 sessions completed
199
+ - **Transcendent** - 100,000 total XP
200
+ - **Omniscient** - All tool mastery badges at Singularity tier
201
+ - **10,000 Hours** - 10,000 hours in sessions
202
+ - **The Architect** - 1,000+ files created
203
+ - **Eternal Flame** - 180-day consecutive streak
204
+ - **The Collector** - Every non-secret, non-aspirational badge unlocked
205
+ - **Centimillionaire** - 100 million characters typed
206
+ - **Token Billionaire** - 1 billion total tokens consumed
129
207
 
130
208
  ### Secret
131
- 10 hidden badges unlocked by specific behaviors. Discover them yourself.
209
+ 17 hidden badges unlocked by specific behaviors. Discover them yourself.
132
210
 
133
211
  ## Rank System
134
212
 
135
- XP is earned from badge tiers. Your rank progresses through:
213
+ 500 numbered ranks with an exponential XP curve. Early ranks come fast; the top 100 are a serious grind.
136
214
 
137
- | Rank | XP Required |
138
- |---|---|
139
- | Bronze | 0 |
140
- | Silver | 1,000 |
141
- | Gold | 5,000 |
142
- | Diamond | 25,000 |
143
- | Obsidian | 100,000 |
215
+ **Formula:** `cumXP(N) = floor(10 * N^2.2)`
216
+
217
+ | Tier | Ranks | Approx. Time |
218
+ |------|-------|-------------|
219
+ | Bronze | 1-100 | First few months |
220
+ | Silver | 101-200 | ~3-4 months |
221
+ | Gold | 201-300 | ~6-9 months |
222
+ | Diamond | 301-400 | ~12-18 months |
223
+ | Obsidian | 401-499 | Each rank takes weeks |
224
+ | System Anomaly | 500 | 2+ years |
225
+
226
+ **XP sources:** prompts (+1), sessions (+5), hours (+10/hr), streaks (+5/day), badge tier unlocks (50-1000), and weekly goals.
227
+
228
+ ## Weekly Goals
229
+
230
+ Two systems that stack for bonus XP:
231
+
232
+ **Activity Multiplier** -- XP bonus based on days active this week:
233
+
234
+ | Days Active | Multiplier |
235
+ |-------------|-----------|
236
+ | 1-2 | 1.0x-1.1x |
237
+ | 3-4 | 1.2x-1.3x |
238
+ | 5-6 | 1.5x-1.75x |
239
+ | 7 | 2.0x |
240
+
241
+ **Challenge Cards** -- 3 rotating challenges generated each Monday from a pool of ~25. Complete them for bonus XP (100-300 per challenge). Examples: "Use 5+ tools in one session", "Submit 50 prompts this week", "Hit a 7-day streak".
144
242
 
145
243
  ## Agent Support
146
244
 
147
- bashstats detects which CLI agent is running:
245
+ bashstats works with multiple AI coding agents. `bashstats init` auto-detects installed agents and sets up hooks for each one.
246
+
247
+ | Agent | Detection | Token Tracking |
248
+ |-------|-----------|----------------|
249
+ | Claude Code | Always installed (default) | Full (input, output, cache) |
250
+ | Gemini CLI | `~/.gemini` directory exists | Approximate (total only) |
251
+ | Copilot CLI | `copilot` binary available | Not available |
252
+ | OpenCode | `~/.config/opencode` exists | Not available |
253
+
254
+ All agents share the same `~/.bashstats/bashstats.db` database. The dashboard agent dropdown filters stats by agent, and the overview tab shows a breakdown when multiple agents are in use.
255
+
256
+ ### How it works
257
+
258
+ - **Claude Code** - Hooks installed in `~/.claude/settings.json`
259
+ - **Gemini CLI** - Hooks installed in `~/.gemini/settings.json`
260
+ - **Copilot CLI** - Hook config written to `~/.copilot/hooks/bashstats-hooks.json`
261
+ - **OpenCode** - Plugin installed at `~/.config/opencode/plugins/bashstats.ts`
148
262
 
149
- - Claude Code (default)
150
- - Gemini CLI
151
- - Copilot CLI
152
- - OpenCode
263
+ `bashstats uninstall` removes hooks from all agents.
153
264
 
154
265
  ## Data Storage
155
266
 
156
267
  All data is stored locally in `~/.bashstats/bashstats.db` (SQLite with WAL mode). Nothing is sent anywhere. Tables:
157
268
 
158
269
  - `events` - Every hook event with full context
159
- - `sessions` - Session lifecycle (start, end, duration, counts)
270
+ - `sessions` - Session lifecycle (start, end, duration, counts, token usage)
160
271
  - `prompts` - Prompt content and word/char counts
161
272
  - `daily_activity` - Aggregated daily stats
162
273
  - `achievement_unlocks` - Badge tier unlock timestamps
274
+ - `weekly_goals` - Weekly challenge cards and completion status
275
+ - `weekly_xp` - Weekly XP totals with multiplier tracking
163
276
 
164
277
  ## Tech Stack
165
278