Conversation
…lysis via ccusage integration
…lter efficiency reporting
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.
PR Auto Describe
Summary
This PR adds Claude Code spending analytics, filter coverage tracking, and CLI refinements for OMNI. It introduces new commands to view filter health, calculate AI savings, and refactors the learn CLI for better usability.
Key Changes
ccusage-based analytics stack with 15-minute disk caching and graceful degradationomni learn coveragecommand for filter performance reportingomni stats --economicsflag for cross-period cost/savings analysisomni learnto use standardized subcommandsDetailed Breakdown
Added
src/analytics/ccusage.rs: wraps theccusagenpm CLI, caches results at~/.omni/ccusage_cache.json, supports fallback pricing for missing/uninitializedccusage. Defines typed metrics (CcusageMetrics) and period economics (PeriodEconomics), plus weighted cost-per-token calculation helpers, with full test coverage.New
src/cli/coverage.rsimplementsomni learn coveragewith human/JSON output, categorizing commands into filter coverage tiers. Refactoredsrc/cli/learn.rsto use subcommands (coverage,discover,apply,verify) instead of legacy flags, updated help text. Expandedsrc/cli/stats.rswith--economicsflag to show cross-period savings, AI spending, and ROI. Registered thecoverageCLI module insrc/cli/mod.rs.Added
CoverageRecordtype andcoverage_analysis()SQL query tosrc/store/sqlite.rsto aggregate filter performance across sessions, plus a dedicated test suite for coverage logic.Exposed the
analyticsmodule insrc/lib.rsandsrc/main.rs, plus added aformat_token_counthelper insrc/cli/stats.rsfor readable token formatting.Notes
ccusagenpm package for full dollar cost reporting; falls back to OMNI-only savings data when missingccusageBreaking Changes
omni learnnow uses subcommands instead of legacy flags:--status→omni learn discover--apply→omni learn apply--verify→omni learn verifyLast updated: 2026-04-12 00:26:11