You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d781670
Browse filesBrowse the repository at this point in the historyBrowse files
Add comprehensive documentation for the new --cost-source option in statusline command:
- Document all four cost source modes: auto, ccusage, cc, both
- Add setup examples for settings.json configuration
- Show output format differences for both mode
- Explain when to use each mode with practical guidance
- Update output format examples with both costs display
References recent PRs:
- feat(statusline): add costSource option to use Claude Code session cost (#571)
- feat(statusline): add 'both' cost source option to display cc and ccusage costs (#574)
-**Model** (`🤖 Opus`): Currently active Claude model
74
-
-**Session Cost** (`💰 $0.23 session`): Cost for the current conversation session
96
+
-**Session Cost** (`💰 $0.23 session`): Cost for the current conversation session (see [Cost Source Options](#cost-source-options) for different calculation modes)
75
97
-**Today's Cost** (`$1.23 today`): Total cost for the current day across all sessions
76
98
-**Session Block** (`$0.45 block (2h 45m left)`): Current 5-hour block cost with remaining time
77
99
-**Burn Rate** (`🔥 $0.12/hr`): Cost burn rate per hour with color-coded indicators:
@@ -108,6 +130,57 @@ The statusline command:
108
130
- Additional metrics display options
109
131
- Session-specific cost tracking
110
132
133
+
### Cost Source Options
134
+
135
+
The `--cost-source` option controls how session costs are calculated and displayed:
136
+
137
+
**Available modes:**
138
+
139
+
-`auto` (default): Prefer Claude Code's pre-calculated cost when available, fallback to ccusage calculation
140
+
-`ccusage`: Always calculate costs using ccusage's token-based calculation with LiteLLM pricing
141
+
-`cc`: Always use Claude Code's pre-calculated cost from session data
142
+
-`both`: Display both Claude Code and ccusage costs side by side for comparison
143
+
144
+
**Command-line usage:**
145
+
146
+
```bash
147
+
# Default auto mode
148
+
bun x ccusage statusline
149
+
150
+
# Always use ccusage calculation
151
+
bun x ccusage statusline --cost-source ccusage
152
+
153
+
# Always use Claude Code cost
154
+
bun x ccusage statusline --cost-source cc
155
+
156
+
# Show both costs for comparison
157
+
bun x ccusage statusline --cost-source both
158
+
```
159
+
160
+
**Settings.json configuration:**
161
+
162
+
```json
163
+
{
164
+
"statusLine": {
165
+
"type": "command",
166
+
"command": "bun x ccusage statusline --cost-source both",
167
+
"padding": 0
168
+
}
169
+
}
170
+
```
171
+
172
+
**When to use each mode:**
173
+
174
+
-**`auto`**: Best for most users, provides accurate costs with fallback reliability
175
+
-**`ccusage`**: When you want consistent calculation methods across all ccusage commands
176
+
-**`cc`**: When you trust Claude Code's cost calculations and want minimal processing
177
+
-**`both`**: For debugging cost discrepancies or comparing calculation methods
0 commit comments