Skip to content

Commit 8276753

Browse files
committed
docs: streamline README with screenshots and developer workflow
- Add feature screenshots (menu bar, daily usage, analytics) - Add installation screenshot with DMG instructions - Add Requirements section before Installation - Add Development section with Claude Code UI workflow - Move architecture details to link (ARCHITECTURE.md) - Remove redundant Data Source section
1 parent 932ed37 commit 8276753

6 files changed

Lines changed: 57 additions & 78 deletions

File tree

README.md

Lines changed: 57 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -4,109 +4,88 @@ A macOS menu bar app for tracking Claude Code usage and costs in real-time.
44

55
## Features
66

7-
- **Menu Bar Cost Display** - Today's cost always visible in menu bar
8-
- **Live Session Monitoring** - Active session indicator with real-time updates
9-
- **Usage Analytics** - Daily, weekly, and monthly breakdowns
10-
- **Yearly Heatmap** - GitHub-style contribution heatmap for cost visualization
11-
- **Cost Alerts** - Visual warnings when daily spending exceeds threshold
12-
- **Open at Login** - Optional automatic launch on system startup
7+
### Menu Bar
8+
- Today's cost always visible
9+
- Live session indicator with duration, tokens, and cost
10+
- Color-coded cost warnings (green → orange → red)
1311

14-
## Data Source
12+
<p align="center">
13+
<img src="docs/screenshots/menu.png" width="280" alt="Menu Bar">
14+
</p>
1515

16-
Reads usage data from `~/.claude/projects/` (Claude Code's local storage).
16+
### Daily Usage
17+
- Day-by-day breakdown of your usage
18+
- Hourly cost charts for each day
1719

18-
## Build & Run
20+
<p align="center">
21+
<img src="docs/screenshots/daily-usage.png" width="600" alt="Daily Usage">
22+
</p>
1923

20-
```bash
21-
cd Packages/ClaudeUsage
22-
swift build # Build all targets
23-
swift test # Run all tests
24-
```
24+
### Analytics
25+
- Yearly heatmap (GitHub-style)
26+
- Predictions and usage trends
2527

26-
## Architecture
28+
<p align="center">
29+
<img src="docs/screenshots/analytics.png" width="600" alt="Analytics">
30+
</p>
2731

28-
### High-Level Overview
32+
## Requirements
2933

30-
The application consists of two main features built on a shared foundation:
34+
- macOS 15.0+
3135

32-
- **Glance** - Menu bar app for real-time monitoring (today's cost, active session, burn rate)
33-
- **Insights** - Main window for analytics and history (model breakdown, daily trends, yearly heatmap)
34-
- **App** - Shared foundation layer (data access, parsing, file system monitoring)
36+
## Installation
3537

36-
### Package Structure
38+
[Download the latest DMG](https://github.com/webcpu/ClaudeCodeUsage/releases/latest/download/ClaudeCodeUsage.dmg), open it, and drag ClaudeCodeUsage to Applications.
3739

38-
```
39-
Packages/ClaudeUsage/Sources/
40-
├── App/ # Shared foundation layer
41-
│ ├── Domain/ # Core types (UsageEntry, TokenCounts)
42-
│ ├── Data/ # Data access (UsageProvider, JSONLParser)
43-
│ ├── Infrastructure/ # System services (DirectoryMonitor)
44-
│ └── Shared/ # Utilities (Composition, AppEnvironment)
45-
46-
├── Glance/ # Menu bar feature
47-
│ ├── Domain/ # TodayCost, UsageSession, SessionFinder
48-
│ ├── Data/ # GlanceService, TodayCostProvider, SessionProvider
49-
│ ├── Stores/ # GlanceStore (@Observable)
50-
│ ├── Infrastructure/ # RefreshCoordinator, Clock, Monitors
51-
│ └── Views/ # GlanceView, GlanceLabel, components
52-
53-
└── Insights/ # Main window feature
54-
├── Domain/ # UsageStats, UsageAggregator, PricingCalculator
55-
├── Data/ # InsightsService
56-
├── Stores/ # InsightsStore (@Observable)
57-
└── Views/ # InsightsView, AnalyticsView, Heatmap
58-
```
40+
<p align="center">
41+
<img src="docs/screenshots/installation.png" width="600" alt="Installation">
42+
</p>
5943

60-
### Clean Architecture Layers
44+
**Required:** Grant Full Disk Access in System Settings → Privacy & Security → Full Disk Access. The app reads usage data from `~/.claude/projects/` which requires this permission.
6145

62-
Each feature follows this consistent layered architecture:
46+
## Development
6347

64-
| Layer | Responsibility | Examples |
65-
|-------|----------------|----------|
66-
| **Views** | SwiftUI rendering, @Environment injection | `GlanceView`, `InsightsView` |
67-
| **Stores** | @Observable state containers | `GlanceStore`, `InsightsStore` |
68-
| **Data** | Actor-based orchestration, caching | `GlanceService`, `InsightsService` |
69-
| **Domain** | Pure business logic, no I/O | `SessionFinder`, `UsageAggregator` |
48+
### Build & Run
7049

71-
### Data Flow
50+
Open `ClaudeCodeUsage.xcodeproj` in Xcode, then build and run (⌘R).
7251

73-
![Data Flow](docs/diagrams/data-flow.svg)
52+
### Develop UI with Claude Code
7453

75-
Data flows from the filesystem through parsing and caching layers to the UI:
54+
#### Setup
7655

77-
1. **FileDiscovery** scans `~/.claude/projects/` for `.jsonl` files
78-
2. **JSONLParser** parses entries with deduplication
79-
3. **UsageProvider** (actor) caches parsed entries by file modification date
80-
4. **Feature Services** transform raw entries into domain objects
81-
5. **Stores** hold observable state for SwiftUI views
56+
1. Open `ClaudeCodeUsage.xcodeproj` in Xcode
57+
2. Show Canvas: Editor → Canvas (or ⌥⌘↩)
58+
3. Select a SwiftUI view file to see its preview
8259

83-
### Refresh Coordination (Glance)
60+
<p align="center">
61+
<img src="docs/previews/xcode-daily-usage-previews.png" width="600" alt="Xcode Previews">
62+
</p>
8463

85-
![Refresh Coordination](docs/diagrams/refresh-coordination.svg)
64+
#### Workflow
8665

87-
The Glance feature stays up-to-date through multiple event monitors:
66+
Give Claude Code a prompt like this:
8867

89-
| Monitor | Trigger | Cache |
90-
|---------|---------|-------|
91-
| FileChangeMonitor | `.jsonl` file changes | Invalidate |
92-
| DayChangeMonitor | Midnight transition | Invalidate |
93-
| FallbackTimer | Periodic (5-10 min) | Preserve |
94-
| WakeMonitor | System wake | Invalidate |
68+
> Make the menu bar chart use a gradient from blue to purple.
69+
>
70+
> After making changes, run:
71+
> ```
72+
> swift run --package-path Packages/ClaudeUsage ScreenshotCapture
73+
> ```
74+
> Then read the screenshot from `/tmp/ClaudeUsage/` to verify. If it doesn't look right, keep iterating until it matches expectations.
9575
96-
### Key Design Patterns
76+
You can also provide a reference image:
9777
98-
| Pattern | Implementation |
99-
|---------|----------------|
100-
| **Actor Isolation** | `UsageProvider`, `GlanceService`, `InsightsService` |
101-
| **@Observable** | `GlanceStore`, `InsightsStore` for SwiftUI |
102-
| **Protocol-Oriented** | `UsageProviding`, `SessionProviding`, `RefreshMonitor` |
103-
| **Strategy Pattern** | `AggregationStrategy<T>` with functional composition |
104-
| **Factory Pattern** | `RefreshCoordinatorFactory` for OCP-compliant assembly |
78+
> Update the Analytics view to match the style in this image: @reference-design.png
79+
>
80+
> Use ScreenshotCapture to verify your changes match the reference.
10581
106-
## Requirements
82+
Claude Code will edit → capture → verify → repeat until the result looks correct.
10783
108-
- macOS 15.0+
109-
- Swift 6.0+
84+
The best part: you can see the visual effects of changes immediately in Xcode previews. All views have previews with real data for rapid iteration without running the full app.
85+
86+
## Architecture
87+
88+
See [ARCHITECTURE.md](Packages/ClaudeUsage/ARCHITECTURE.md) for detailed design documentation.
11089
11190
## License
11291
1.11 MB
Loading

docs/screenshots/analytics.png

663 KB
Loading

docs/screenshots/daily-usage.png

711 KB
Loading

docs/screenshots/installation.png

431 KB
Loading

docs/screenshots/menu.png

85.8 KB
Loading

0 commit comments

Comments
 (0)