fix: resolve bugs, optimize performance, and add new commands - #1
Merged
Merged
Conversation
Bug fixes: - Fix logOneline hash parsing to handle variable-length abbreviated hashes - Fix Math.max spread overflow in aggregators for large datasets - Replace process.exit(1) with thrown errors for better testability - Add XSS defense-in-depth escaping in HTML template - Add error handling for file writes and browser open in report Performance: - Optimize search.ts: N+1 git calls → single listTree on latest commit - Optimize stats.ts: same optimization, eliminating per-hash subprocess spawning Code quality: - Refactor quick.ts: extract common helper, reduce 84 lines → 35 lines - Strengthen weak test assertions in aggregators and diff tests New commands: - `cost` - Analyze estimated API costs with breakdown and top sessions - `show <hash>` - View detailed info for a single checkpoint - `summary` - Show daily work summary grouped by date Tests: - Add tests for quick.ts, csv.ts, html-template.ts, cost.ts, show.ts, summary.ts - Add logOneline longer hash test and negative delta diff test - 92 → 106 tests, all passing https://claude.ai/code/session_012CJWK738LEWi7o9XtoQnWQ
New commands: - `hotspots` - Identify files that attract repeated AI modifications, ranked by session count with date range and avg AI contribution - `timeline` - Terminal ASCII activity heatmap with streak tracking, shows activity over N weeks with colored block characters - `export <hash>` - Extract checkpoint files to local directory or generate a consolidated markdown summary (--format md) All three commands support --branch, --since, --until, --json filters. Tests: 106 → 122 tests, all passing (18 test files) https://claude.ai/code/session_012CJWK738LEWi7o9XtoQnWQ
Replace single hardcoded pricing with a model pricing table covering 8 Claude models (Opus 4/4.5/4.6, Sonnet 4/4.5/4.6, Haiku 3.5/4.5). - Add MODEL_PRICING record and getModelPricing() helper in constants.ts - Add --model flag to cost command (default: sonnet-4.5) - Display model name and per-1K unit prices in cost output - Maintain backwards compatibility via PRICING re-export - Add tests for model pricing lookup and cross-model cost comparison 126 tests passing. https://claude.ai/code/session_012CJWK738LEWi7o9XtoQnWQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.