Conversation
- Add ClaudeUsageCore: domain layer with unified models and protocols - Add ClaudeUsageData: data layer with repository and monitoring - Add ClaudeMonitorCLI: new unified CLI using ClaudeUsageData - Rename app from ClaudeCodeUsage to ClaudeUsage - Unify UsageEntry, TokenCounts, SessionBlock into single definitions - Establish clean downward dependency flow: App -> Data -> Core
- Remove ClaudeCodeUsageKit dependency from app target - Add compatibility extensions for Kit API parity: - UsageEntry+Compatibility: .cost, .date, individual token fields - UsageStats+Compatibility: token accessors, modelCount, legacy init - Move UsageAnalytics to Core with pure functions - Add LiveMonitorConversion for SessionBlock/BurnRate boundary conversion - Update UsageDataLoader to use any UsageRepository protocol - Update SessionMonitorService to return Core types - Update all 24 view files to import ClaudeUsageCore Architecture now flows: App → Core/Data → [LiveMonitor at boundary] ClaudeCodeUsageKit is no longer required by app (still used by tests)
- Opus: / → / per MTok - Haiku: /bin/zsh.25/.25 → / per MTok - Sonnet: unchanged at / per MTok - Cache pricing: write=1.25x input, read=0.1x input
- Delete Sources/ClaudeCodeUsageKit/ (15 files, ~1500 lines) - Delete Tests/ClaudeCodeUsageKitTests/ (2 test files) - Delete Packages/TimingMacro/ (unused after Kit removal) - Simplify Package.swift (remove Kit product, target, tests) Architecture now: ClaudeUsageCore (domain) ← ClaudeUsageData (data) ← ClaudeUsage (app)
ClaudeUsageData's SessionMonitorImpl already provides the same functionality using native ClaudeUsageCore types. Changes: - Update SessionMonitorService to use SessionMonitorImpl - Delete LiveMonitorConversion.swift (no longer needed) - Delete Packages/ClaudeLiveMonitor/ (15 files, ~1000 lines) - Remove ClaudeLiveMonitor from Package.swift dependencies Architecture now has zero conversion layers: Core (types) ← Data (impl) ← App (uses native types)
Protocols describe capabilities (use -ing/-able suffixes): - UsageRepository → UsageDataSource - SessionMonitor → SessionDataSource Concrete types use clean noun names: - UsageRepositoryImpl → UsageRepository - SessionMonitorImpl → SessionMonitor Per: https://www.swift.org/documentation/api-design-guidelines/
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.
⏺ Clean Architecture Migration
Restructure codebase into layered packages following Clean Architecture principles.
Changes
Architecture:
ClaudeUsageCore (domain) ← ClaudeUsageData (data) ← ClaudeUsage (app)