Skip to content

Commit 3cdaac9

Browse files
authored
Merge branch 'main' into main
2 parents 14c9176 + 1909aba commit 3cdaac9

15 files changed

Lines changed: 380 additions & 310 deletions

‎.github/workflows/release.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2020
with:
2121
registry-url: 'https://registry.npmjs.org'
22-
node-version: ${{env.NODE_VERSION}}
22+
node-version: lts/*
2323
- uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
24+
- run: npm install -g npm@latest
2425
- run: bun install --frozen-lockfile
2526
- run: npm publish --provenance --no-git-checks --access public
2627
env:
27-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
2828
NPM_CONFIG_PROVENANCE: true
2929
working-directory: ${{env.PACKAGE_DIR}}
3030

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ Full documentation is available at **[ccusage.com](https://ccusage.com/)**
106106

107107
### Featured Sponsor
108108

109-
Check out these [47 Claude Code ProTips from Greg Baugues.](https://www.youtube.com/watch?v=TiNpzxoBPz0&lc=UgyVgQyOhfJJlheVMcB4AaABAg)
109+
Check out [ccusage: The Claude Code cost scorecard that went viral](https://www.youtube.com/watch?v=Ak6qpQ5qdgk)
110110

111111
<p align="center">
112-
<a href="https://www.youtube.com/watch?v=TiNpzxoBPz0&lc=UgyVgQyOhfJJlheVMcB4AaABAg">
113-
<img src="https://cdn.jsdelivr.net/gh/ryoppippi/ccusage@main/docs/public/claude_code_protips_thumbnail_v1.png" alt="47 Claude Code ProTips from Greg Baugues" width="600">
112+
<a href="https://www.youtube.com/watch?v=Ak6qpQ5qdgk">
113+
<img src="https://cdn.jsdelivr.net/gh/ryoppippi/ccusage@main/docs/public/ccusage_thumbnail.png" alt="ccusage: The Claude Code cost scorecard that went viral" width="600">
114114
</a>
115115
</p>
116116

‎bun.lock‎

Lines changed: 130 additions & 283 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/.vitepress/config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export default withMermaid(defineConfig({
7777
{ text: 'Library Usage', link: '/guide/library-usage' },
7878
{ text: 'MCP Server', link: '/guide/mcp-server' },
7979
{ text: 'JSON Output', link: '/guide/json-output' },
80+
{ text: 'Statusline Integration', link: '/guide/statusline' },
8081
],
8182
},
8283
{

‎docs/guide/related-projects.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ Projects that use ccusage internally or extend its functionality:
1414
- [ccusage Raycast Extension](https://www.raycast.com/nyatinte/ccusage) - Raycast integration for quick usage checks
1515
- [ccusage.nvim](https://github.com/S1M0N38/ccusage.nvim) - Track Claude Code usage in Neovim
1616

17+
## Web Applications
18+
19+
- [viberank](https://viberank.app) - A community-driven leaderboard for Claude Code usage. ([GitHub](https://github.com/sculptdotfun/viberank))
20+
1721
## Contributing
1822

1923
If you've built something that uses ccusage, please feel free to open a pull request to add it to this list!

‎docs/guide/session-reports.md‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,44 @@ Session reports show your Claude Code usage grouped by individual conversation s
88
ccusage session
99
```
1010

11+
## Specific Session Lookup
12+
13+
Query individual session details by providing a session ID:
14+
15+
```bash
16+
ccusage session --id <session-id>
17+
```
18+
19+
This is particularly useful for:
20+
- **Custom statuslines**: Integrate specific session data into your development environment
21+
- **Programmatic usage**: Extract session metrics for scripts and automation
22+
- **Detailed analysis**: Get comprehensive data about a single conversation
23+
24+
### Examples
25+
26+
```bash
27+
# Get session data in table format
28+
ccusage session --id session-abc123-def456
29+
30+
# Get session data as JSON for scripting
31+
ccusage session --id session-abc123-def456 --json
32+
33+
# Extract just the cost using jq
34+
ccusage session --id session-abc123-def456 --json --jq '.totalCost'
35+
36+
# Use in a custom statusline script
37+
COST=$(ccusage session --id "$SESSION_ID" --json --jq '.totalCost')
38+
echo "Current session: \$${COST}"
39+
```
40+
41+
### Session ID Format
42+
43+
Session IDs are the actual filenames (without `.jsonl` extension) stored in Claude's data directories. They typically look like:
44+
- `session-20250621-abc123-def456`
45+
- `project-conversation-xyz789`
46+
47+
You can find session IDs by running `ccusage session` and looking for the files in your Claude data directory.
48+
1149
## Example Output
1250

1351
```
@@ -51,6 +89,27 @@ Sessions are sorted by cost (highest first) by default, making it easy to identi
5189

5290
## Command Options
5391

92+
### Session ID Lookup
93+
94+
Get detailed information about a specific session:
95+
96+
```bash
97+
# Query a specific session by ID
98+
ccusage session --id <session-id>
99+
100+
# Get JSON output for a specific session
101+
ccusage session --id <session-id> --json
102+
103+
# Short form using -i flag
104+
ccusage session -i <session-id>
105+
```
106+
107+
**Use cases:**
108+
- Building custom statuslines that show current session costs
109+
- Creating scripts that monitor specific conversation expenses
110+
- Debugging or analyzing individual conversation patterns
111+
- Integrating session data into development workflows
112+
54113
### Date Filtering
55114

56115
Filter sessions by their last activity date:

‎docs/guide/sponsors.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Support ccusage development by becoming a sponsor! Your contribution helps maint
44

55
## Featured Sponsor
66

7-
Check out these [47 Claude Code ProTips from Greg Baugues.](https://www.youtube.com/watch?v=TiNpzxoBPz0&lc=UgyVgQyOhfJJlheVMcB4AaABAg)
7+
Check out [ccusage: The Claude Code cost scorecard that went viral](https://www.youtube.com/watch?v=Ak6qpQ5qdgk)
88

99
<p align="center">
10-
<a href="https://www.youtube.com/watch?v=TiNpzxoBPz0&lc=UgyVgQyOhfJJlheVMcB4AaABAg">
11-
<img src="/claude_code_protips_thumbnail_v1.png" alt="47 Claude Code ProTips from Greg Baugues" width="600">
10+
<a href="https://www.youtube.com/watch?v=Ak6qpQ5qdgk">
11+
<img src="/ccusage_thumbnail.png" alt="ccusage: The Claude Code cost scorecard that went viral" width="600">
1212
</a>
1313
</p>
1414

‎docs/index.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ features:
7171
<p style="margin-bottom: 1.5rem;">If you find ccusage helpful, please consider sponsoring the development!</p>
7272

7373
<h3 style="margin-bottom: 1rem;">Featured Sponsor</h3>
74-
<p style="margin-bottom: 1rem;">Check out these <a href="https://www.youtube.com/watch?v=TiNpzxoBPz0&lc=UgyVgQyOhfJJlheVMcB4AaABAg" target="_blank">47 Claude Code ProTips from Greg Baugues.</a></p>
75-
<a href="https://www.youtube.com/watch?v=TiNpzxoBPz0&lc=UgyVgQyOhfJJlheVMcB4AaABAg" target="_blank">
76-
<img src="/claude_code_protips_thumbnail_v1.png" alt="47 Claude Code ProTips from Greg Baugues" style="max-width: 600px; height: auto;">
74+
<p style="margin-bottom: 1rem;">Check out <a href="https://www.youtube.com/watch?v=Ak6qpQ5qdgk" target="_blank">ccusage: The Claude Code cost scorecard that went viral</a></p>
75+
<a href="https://www.youtube.com/watch?v=Ak6qpQ5qdgk" target="_blank">
76+
<img src="/ccusage_thumbnail.png" alt="ccusage: The Claude Code cost scorecard that went viral" style="max-width: 600px; height: auto;">
7777
</a>
7878

7979
<div style="margin-top: 2rem;">

‎docs/package.json‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,12 @@
55
"description": "Documentation for ccusage",
66
"type": "module",
77
"scripts": {
8-
"build": "bun run docs:api && ROLLDOWN_OPTIONS_VALIDATION=loose vitepress build",
8+
"build": "bun run docs:api && vitepress build",
99
"deploy": "wrangler deploy",
10-
"dev": "bun run docs:api && ROLLDOWN_OPTIONS_VALIDATION=loose vitepress dev",
10+
"dev": "bun run docs:api && vitepress dev",
1111
"docs:api": "./update-api-index.ts",
1212
"preview": "vitepress preview"
1313
},
14-
"overrides": {
15-
"vite": "npm:rolldown-vite@latest"
16-
},
1714
"devDependencies": {
1815
"@ryoppippi/vite-plugin-cloudflare-redirect": "npm:@jsr/ryoppippi__vite-plugin-cloudflare-redirect",
1916
"@types/bun": "^1.2.19",
@@ -22,7 +19,7 @@
2219
"typedoc-plugin-markdown": "^4.8.0",
2320
"typedoc-vitepress-theme": "^1.1.2",
2421
"vitepress": "^1.6.4",
25-
"vitepress-plugin-group-icons": "^1.6.1",
22+
"vitepress-plugin-group-icons": "^1.6.2",
2623
"vitepress-plugin-llms": "^1.7.2",
2724
"vitepress-plugin-mermaid": "^2.0.17",
2825
"wrangler": "^4.28.1"

‎docs/public/ccusage_thumbnail.png‎

711 KB
Loading

0 commit comments

Comments
 (0)