-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add auto-updating savings data to current-session.txt (issue #113) #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -481,7 +481,7 @@ await get_session_stats({}); | |||||||
| "tokenReductionPercent": 68.2, | ||||||||
| "originalTokens": 184000, | ||||||||
| "optimizedTokens": 58570, | ||||||||
| "cacheHitRate": 0.72, | ||||||||
| "cacheHitRate": 72.0, | ||||||||
| "byTool": { | ||||||||
| "smart_read": { "saved": 45000, "percent": 80 }, | ||||||||
| "smart_grep": { "saved": 32000, "percent": 75 } | ||||||||
|
|
@@ -495,20 +495,36 @@ All operations are automatically tracked in session data files: | |||||||
|
|
||||||||
| **Location**: `~/.claude-global/hooks/data/current-session.txt` | ||||||||
|
|
||||||||
| **IMPORTANT**: This file shows operation tracking, NOT token savings: | ||||||||
| **Format**: | ||||||||
|
|
||||||||
| ```json | ||||||||
| { | ||||||||
| "sessionId": "abc-123", | ||||||||
| "sessionStart": "20251031-082211", | ||||||||
| "totalOperations": 1250, // ← Number of operations | ||||||||
| "totalTokens": 184000, // ← Cumulative token COUNT (not savings!) | ||||||||
| "lastOptimized": 1698765432 | ||||||||
| "totalTokens": 184000, // ← Cumulative token COUNT | ||||||||
| "lastOptimized": 1698765432, | ||||||||
| "savings": { // ← Auto-updated every 10 operations (Issue #113) | ||||||||
| "totalTokensSaved": 125430, // Tokens saved by compression | ||||||||
| "tokenReductionPercent": 68.2, // Percentage of tokens saved | ||||||||
| "originalTokens": 184000, // Original token count before optimization | ||||||||
| "optimizedTokens": 58570, // Token count after optimization | ||||||||
| "cacheHitRate": 42.5, // Cache hit rate percentage | ||||||||
|
||||||||
| "cacheHitRate": 42.5, // Cache hit rate percentage | |
| "cacheHitRate": 72.0, // Cache hit rate percentage |
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
Copilot
AI
Nov 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The documentation mentions 'PowerShell hooks' which may not apply to all users. Consider clarifying whether this automatic update mechanism works across all platforms or is platform-specific.
| - Every 10 operations, the PowerShell hooks automatically call `get_cache_stats()` MCP tool | |
| - On Windows, every 10 operations, the PowerShell hooks automatically call `get_cache_stats()` MCP tool | |
| - On other platforms, you may need to manually call `get_cache_stats()` or set up a similar hook using your preferred shell (e.g., Bash, Zsh) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Timestamp format uses 'YYYYMMDD-HHMMSS' pattern. Consider adding clarification in documentation that this represents '2025-10-31 08:22:11' to improve readability.