ccusage 18.0.4 → 18.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -31,11 +31,11 @@ Companion tool for analyzing OpenAI Codex usage. Same powerful features as ccusa
31
31
 
32
32
  ### 🚀 [@ccusage/opencode](https://www.npmjs.com/package/@ccusage/opencode) - OpenCode Usage Analyzer
33
33
 
34
- Companion tool for analyzing OpenCode (Claude Code fork) usage. Track token usage and costs from OpenCode sessions with the same reporting capabilities as ccusage.
34
+ Companion tool for analyzing [OpenCode](https://github.com/opencode-ai/opencode) usage. Track token usage and costs from OpenCode sessions with the same reporting capabilities as ccusage.
35
35
 
36
36
  ### 🥧 [@ccusage/pi](https://www.npmjs.com/package/@ccusage/pi) - Pi-agent Usage Analyzer
37
37
 
38
- Companion tool for analyzing [pi-agent](https://github.com/nicobailon/pi-agent) session usage. Track token usage and costs from your pi-agent sessions with daily, monthly, and session-based reports.
38
+ Companion tool for analyzing [pi-agent](https://github.com/badlogic/pi-mono) session usage. Track token usage and costs from your pi-agent sessions with daily, monthly, and session-based reports.
39
39
 
40
40
  ### ⚡ [@ccusage/amp](https://www.npmjs.com/package/@ccusage/amp) - Amp Usage Analyzer
41
41
 
@@ -1,5 +1,5 @@
1
1
  import { A as object, C as boolean, F as string, M as parse$2, P as safeParse, R as union, S as array, _ as requestIdSchema, a as createDailyDate, b as versionSchema, c as createSessionId, f as isoTimestampSchema, g as projectPathSchema, h as monthlyDateSchema, i as createBucket, j as optional, k as number, l as createWeeklyDate, m as modelNameSchema, o as createMonthlyDate, p as messageIdSchema, r as activityDateSchema, s as createProjectPath, u as dailyDateSchema, v as sessionIdSchema, x as weeklyDateSchema, z as getTotalTokens } from "./_types-BFL_bTNX.js";
2
- import { n as logger } from "./logger-CTYPBNFO.js";
2
+ import { n as logger } from "./logger-DAC2389p.js";
3
3
  import { createRequire } from "node:module";
4
4
  import * as nativeFs from "node:fs";
5
5
  import b, { createReadStream } from "node:fs";
@@ -4799,9 +4799,15 @@ const PREFETCHED_CLAUDE_PRICING = {
4799
4799
  "anthropic.claude-3-5-sonnet-20240620-v1:0": {
4800
4800
  "input_cost_per_token": 3e-6,
4801
4801
  "output_cost_per_token": 15e-6,
4802
+ "cache_creation_input_token_cost": 375e-8,
4803
+ "cache_read_input_token_cost": 3e-7,
4802
4804
  "max_tokens": 4096,
4803
- "max_input_tokens": 2e5,
4804
- "max_output_tokens": 4096
4805
+ "max_input_tokens": 1e6,
4806
+ "max_output_tokens": 4096,
4807
+ "input_cost_per_token_above_200k_tokens": 6e-6,
4808
+ "output_cost_per_token_above_200k_tokens": 3e-5,
4809
+ "cache_creation_input_token_cost_above_200k_tokens": 75e-7,
4810
+ "cache_read_input_token_cost_above_200k_tokens": 6e-7
4805
4811
  },
4806
4812
  "anthropic.claude-3-5-sonnet-20241022-v2:0": {
4807
4813
  "input_cost_per_token": 3e-6,
@@ -4809,8 +4815,12 @@ const PREFETCHED_CLAUDE_PRICING = {
4809
4815
  "cache_creation_input_token_cost": 375e-8,
4810
4816
  "cache_read_input_token_cost": 3e-7,
4811
4817
  "max_tokens": 8192,
4812
- "max_input_tokens": 2e5,
4813
- "max_output_tokens": 8192
4818
+ "max_input_tokens": 1e6,
4819
+ "max_output_tokens": 8192,
4820
+ "input_cost_per_token_above_200k_tokens": 6e-6,
4821
+ "output_cost_per_token_above_200k_tokens": 3e-5,
4822
+ "cache_creation_input_token_cost_above_200k_tokens": 75e-7,
4823
+ "cache_read_input_token_cost_above_200k_tokens": 6e-7
4814
4824
  },
4815
4825
  "anthropic.claude-3-7-sonnet-20240620-v1:0": {
4816
4826
  "input_cost_per_token": 36e-7,
@@ -4885,6 +4895,32 @@ const PREFETCHED_CLAUDE_PRICING = {
4885
4895
  "max_input_tokens": 2e5,
4886
4896
  "max_output_tokens": 64e3
4887
4897
  },
4898
+ "anthropic.claude-opus-4-6-v1": {
4899
+ "input_cost_per_token": 5e-6,
4900
+ "output_cost_per_token": 25e-6,
4901
+ "cache_creation_input_token_cost": 625e-8,
4902
+ "cache_read_input_token_cost": 5e-7,
4903
+ "max_tokens": 128e3,
4904
+ "max_input_tokens": 1e6,
4905
+ "max_output_tokens": 128e3,
4906
+ "input_cost_per_token_above_200k_tokens": 1e-5,
4907
+ "output_cost_per_token_above_200k_tokens": 375e-7,
4908
+ "cache_creation_input_token_cost_above_200k_tokens": 125e-7,
4909
+ "cache_read_input_token_cost_above_200k_tokens": 1e-6
4910
+ },
4911
+ "anthropic.claude-sonnet-4-6": {
4912
+ "input_cost_per_token": 3e-6,
4913
+ "output_cost_per_token": 15e-6,
4914
+ "cache_creation_input_token_cost": 375e-8,
4915
+ "cache_read_input_token_cost": 3e-7,
4916
+ "max_tokens": 64e3,
4917
+ "max_input_tokens": 2e5,
4918
+ "max_output_tokens": 64e3,
4919
+ "input_cost_per_token_above_200k_tokens": 6e-6,
4920
+ "output_cost_per_token_above_200k_tokens": 225e-7,
4921
+ "cache_creation_input_token_cost_above_200k_tokens": 75e-7,
4922
+ "cache_read_input_token_cost_above_200k_tokens": 6e-7
4923
+ },
4888
4924
  "anthropic.claude-sonnet-4-20250514-v1:0": {
4889
4925
  "input_cost_per_token": 3e-6,
4890
4926
  "output_cost_per_token": 15e-6,
@@ -5047,7 +5083,7 @@ const PREFETCHED_CLAUDE_PRICING = {
5047
5083
  "output_cost_per_token": 15e-6,
5048
5084
  "cache_creation_input_token_cost": 375e-8,
5049
5085
  "cache_read_input_token_cost": 3e-7,
5050
- "max_tokens": 1e6,
5086
+ "max_tokens": 64e3,
5051
5087
  "max_input_tokens": 1e6,
5052
5088
  "max_output_tokens": 64e3,
5053
5089
  "input_cost_per_token_above_200k_tokens": 6e-6,
@@ -5081,6 +5117,19 @@ const PREFETCHED_CLAUDE_PRICING = {
5081
5117
  "cache_creation_input_token_cost_above_200k_tokens": 75e-7,
5082
5118
  "cache_read_input_token_cost_above_200k_tokens": 6e-7
5083
5119
  },
5120
+ "claude-sonnet-4-6": {
5121
+ "input_cost_per_token": 3e-6,
5122
+ "output_cost_per_token": 15e-6,
5123
+ "cache_creation_input_token_cost": 375e-8,
5124
+ "cache_read_input_token_cost": 3e-7,
5125
+ "max_tokens": 64e3,
5126
+ "max_input_tokens": 2e5,
5127
+ "max_output_tokens": 64e3,
5128
+ "input_cost_per_token_above_200k_tokens": 6e-6,
5129
+ "output_cost_per_token_above_200k_tokens": 225e-7,
5130
+ "cache_creation_input_token_cost_above_200k_tokens": 75e-7,
5131
+ "cache_read_input_token_cost_above_200k_tokens": 6e-7
5132
+ },
5084
5133
  "claude-sonnet-4-5-20250929-v1:0": {
5085
5134
  "input_cost_per_token": 3e-6,
5086
5135
  "output_cost_per_token": 15e-6,
@@ -5139,6 +5188,32 @@ const PREFETCHED_CLAUDE_PRICING = {
5139
5188
  "max_input_tokens": 2e5,
5140
5189
  "max_output_tokens": 64e3
5141
5190
  },
5191
+ "claude-opus-4-6": {
5192
+ "input_cost_per_token": 5e-6,
5193
+ "output_cost_per_token": 25e-6,
5194
+ "cache_creation_input_token_cost": 625e-8,
5195
+ "cache_read_input_token_cost": 5e-7,
5196
+ "max_tokens": 128e3,
5197
+ "max_input_tokens": 1e6,
5198
+ "max_output_tokens": 128e3,
5199
+ "input_cost_per_token_above_200k_tokens": 1e-5,
5200
+ "output_cost_per_token_above_200k_tokens": 375e-7,
5201
+ "cache_creation_input_token_cost_above_200k_tokens": 125e-7,
5202
+ "cache_read_input_token_cost_above_200k_tokens": 1e-6
5203
+ },
5204
+ "claude-opus-4-6-20260205": {
5205
+ "input_cost_per_token": 5e-6,
5206
+ "output_cost_per_token": 25e-6,
5207
+ "cache_creation_input_token_cost": 625e-8,
5208
+ "cache_read_input_token_cost": 5e-7,
5209
+ "max_tokens": 128e3,
5210
+ "max_input_tokens": 1e6,
5211
+ "max_output_tokens": 128e3,
5212
+ "input_cost_per_token_above_200k_tokens": 1e-5,
5213
+ "output_cost_per_token_above_200k_tokens": 375e-7,
5214
+ "cache_creation_input_token_cost_above_200k_tokens": 125e-7,
5215
+ "cache_read_input_token_cost_above_200k_tokens": 1e-6
5216
+ },
5142
5217
  "claude-sonnet-4-20250514": {
5143
5218
  "input_cost_per_token": 3e-6,
5144
5219
  "output_cost_per_token": 15e-6,
@@ -1,4 +1,4 @@
1
- import { C as transcriptUsageSchema, S as transcriptMessageSchema, T as weeklyUsageSchema, _ as loadWeeklyUsageData, a as dailyUsageSchema, b as sessionUsageSchema, c as getEarliestTimestamp, d as loadBucketUsageData, f as loadDailyUsageData, g as loadSessionUsageById, h as loadSessionData, i as createUniqueHash, l as getUsageLimitResetTime, m as loadSessionBlockData, n as calculateContextTokens, o as extractProjectFromPath, p as loadMonthlyUsageData, r as calculateCostForEntry, s as getClaudePaths, t as bucketUsageSchema, u as globUsageFiles, v as modelBreakdownSchema, w as usageDataSchema, x as sortFilesByTimestamp, y as monthlyUsageSchema } from "./data-loader-CzgabDPJ.js";
1
+ import { C as transcriptUsageSchema, S as transcriptMessageSchema, T as weeklyUsageSchema, _ as loadWeeklyUsageData, a as dailyUsageSchema, b as sessionUsageSchema, c as getEarliestTimestamp, d as loadBucketUsageData, f as loadDailyUsageData, g as loadSessionUsageById, h as loadSessionData, i as createUniqueHash, l as getUsageLimitResetTime, m as loadSessionBlockData, n as calculateContextTokens, o as extractProjectFromPath, p as loadMonthlyUsageData, r as calculateCostForEntry, s as getClaudePaths, t as bucketUsageSchema, u as globUsageFiles, v as modelBreakdownSchema, w as usageDataSchema, x as sortFilesByTimestamp, y as monthlyUsageSchema } from "./data-loader-DpE9AkIH.js";
2
2
  import "./_types-BFL_bTNX.js";
3
- import "./logger-CTYPBNFO.js";
3
+ import "./logger-DAC2389p.js";
4
4
  export { bucketUsageSchema, calculateContextTokens, calculateCostForEntry, createUniqueHash, dailyUsageSchema, extractProjectFromPath, getClaudePaths, getEarliestTimestamp, getUsageLimitResetTime, globUsageFiles, loadBucketUsageData, loadDailyUsageData, loadMonthlyUsageData, loadSessionBlockData, loadSessionData, loadSessionUsageById, loadWeeklyUsageData, modelBreakdownSchema, monthlyUsageSchema, sessionUsageSchema, sortFilesByTimestamp, transcriptMessageSchema, transcriptUsageSchema, usageDataSchema, weeklyUsageSchema };
@@ -1,6 +1,6 @@
1
- import { A as PricingFetcher, J as CLAUDE_PROJECTS_DIR_NAME, W as _usingCtx, X as DEBUG_MATCH_THRESHOLD_PERCENT, at as try_, ft as isFailure, it as unwrap, rt as glob, s as getClaudePaths, tt as USAGE_DATA_GLOB_PATTERN, w as usageDataSchema } from "./data-loader-CzgabDPJ.js";
1
+ import { A as PricingFetcher, J as CLAUDE_PROJECTS_DIR_NAME, W as _usingCtx, X as DEBUG_MATCH_THRESHOLD_PERCENT, at as try_, ft as isFailure, it as unwrap, rt as glob, s as getClaudePaths, tt as USAGE_DATA_GLOB_PATTERN, w as usageDataSchema } from "./data-loader-DpE9AkIH.js";
2
2
  import { P as safeParse } from "./_types-BFL_bTNX.js";
3
- import { n as logger } from "./logger-CTYPBNFO.js";
3
+ import { n as logger } from "./logger-DAC2389p.js";
4
4
  import { readFile } from "node:fs/promises";
5
5
  import path from "node:path";
6
6
  async function detectMismatches(claudePath) {
package/dist/debug.js CHANGED
@@ -1,5 +1,5 @@
1
- import "./data-loader-CzgabDPJ.js";
1
+ import "./data-loader-DpE9AkIH.js";
2
2
  import "./_types-BFL_bTNX.js";
3
- import "./logger-CTYPBNFO.js";
4
- import { n as printMismatchReport, t as detectMismatches } from "./debug-DDgg0GCg.js";
3
+ import "./logger-DAC2389p.js";
4
+ import { n as printMismatchReport, t as detectMismatches } from "./debug-CIMCQIkM.js";
5
5
  export { detectMismatches, printMismatchReport };
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { $ as DEFAULT_RECENT_DAYS, B as pushBreakdownRows, D as calculateBurnRate, E as DEFAULT_SESSION_DURATION_HOURS, F as formatDateCompact, G as BLOCKS_COMPACT_WIDTH_THRESHOLD, H as getFileModifiedTime, I as formatModelsDisplayMultiline, K as BLOCKS_DEFAULT_TERMINAL_WIDTH, L as formatNumber, M as addEmptySeparatorRow, N as createUsageReportTable, O as filterRecentBlocks, P as formatCurrency, Q as DEFAULT_LOCALE, R as formatTotalsRow, U as unreachable, V as require_picocolors, W as _usingCtx, Y as CONFIG_FILE_NAME, Z as DEFAULT_CONTEXT_USAGE_THRESHOLDS, _ as loadWeeklyUsageData, at as try_, ct as inspectError, dt as isSuccess, et as DEFAULT_REFRESH_INTERVAL_SECONDS, f as loadDailyUsageData, ft as isFailure, g as loadSessionUsageById, h as loadSessionData, it as unwrap, j as ResponsiveTable, k as projectBlockUsage, lt as inspect, m as loadSessionBlockData, mt as __toESM, n as calculateContextTokens, nt as WEEK_DAYS, ot as pipe, p as loadMonthlyUsageData, pt as toArray, q as BLOCKS_WARNING_THRESHOLD, s as getClaudePaths, st as map$1, ut as succeed, z as formatUsageDataRow } from "./data-loader-CzgabDPJ.js";
2
+ import { $ as DEFAULT_RECENT_DAYS, B as pushBreakdownRows, D as calculateBurnRate, E as DEFAULT_SESSION_DURATION_HOURS, F as formatDateCompact, G as BLOCKS_COMPACT_WIDTH_THRESHOLD, H as getFileModifiedTime, I as formatModelsDisplayMultiline, K as BLOCKS_DEFAULT_TERMINAL_WIDTH, L as formatNumber, M as addEmptySeparatorRow, N as createUsageReportTable, O as filterRecentBlocks, P as formatCurrency, Q as DEFAULT_LOCALE, R as formatTotalsRow, U as unreachable, V as require_picocolors, W as _usingCtx, Y as CONFIG_FILE_NAME, Z as DEFAULT_CONTEXT_USAGE_THRESHOLDS, _ as loadWeeklyUsageData, at as try_, ct as inspectError, dt as isSuccess, et as DEFAULT_REFRESH_INTERVAL_SECONDS, f as loadDailyUsageData, ft as isFailure, g as loadSessionUsageById, h as loadSessionData, it as unwrap, j as ResponsiveTable, k as projectBlockUsage, lt as inspect, m as loadSessionBlockData, mt as __toESM, n as calculateContextTokens, nt as WEEK_DAYS, ot as pipe, p as loadMonthlyUsageData, pt as toArray, q as BLOCKS_WARNING_THRESHOLD, s as getClaudePaths, st as map$1, ut as succeed, z as formatUsageDataRow } from "./data-loader-DpE9AkIH.js";
3
3
  import { D as maxValue, E as integer$1, F as string, I as transform, L as trim, M as parse$1, N as pipe$1, O as minValue, P as safeParse, R as union, T as flatten, d as filterDateSchema, k as number, n as SortOrders, t as CostModes, w as check, y as statuslineHookJsonSchema, z as getTotalTokens } from "./_types-BFL_bTNX.js";
4
4
  import { n as createTotalsObject, t as calculateTotals } from "./calculate-cost-CKH-OC_c.js";
5
- import { a as version, i as name, n as logger, r as description, t as log } from "./logger-CTYPBNFO.js";
6
- import { n as printMismatchReport, t as detectMismatches } from "./debug-DDgg0GCg.js";
5
+ import { a as version, i as name, n as logger, r as description, t as log } from "./logger-DAC2389p.js";
6
+ import { n as printMismatchReport, t as detectMismatches } from "./debug-CIMCQIkM.js";
7
7
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
8
8
  import a from "node:fs/promises";
9
9
  import path, { join } from "node:path";
@@ -866,7 +866,7 @@ function createLogger(name$1) {
866
866
  }
867
867
  const log = console.log;
868
868
  var name = "ccusage";
869
- var version = "18.0.4";
869
+ var version = "18.0.6";
870
870
  var description = "Usage analysis tool for Claude Code";
871
871
  const logger = createLogger(name);
872
872
  const log$1 = log;
package/dist/logger.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as logger, t as log } from "./logger-CTYPBNFO.js";
1
+ import { n as logger, t as log } from "./logger-DAC2389p.js";
2
2
  export { log, logger };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ccusage",
3
3
  "type": "module",
4
- "version": "18.0.4",
4
+ "version": "18.0.6",
5
5
  "description": "Usage analysis tool for Claude Code",
6
6
  "author": "ryoppippi",
7
7
  "license": "MIT",
@@ -9,7 +9,8 @@
9
9
  "homepage": "https://github.com/ryoppippi/ccusage#readme",
10
10
  "repository": {
11
11
  "type": "git",
12
- "url": "git+https://github.com/ryoppippi/ccusage.git"
12
+ "url": "git+https://github.com/ryoppippi/ccusage.git",
13
+ "directory": "apps/ccusage"
13
14
  },
14
15
  "bugs": {
15
16
  "url": "https://github.com/ryoppippi/ccusage/issues"
@@ -33,6 +34,22 @@
33
34
  "dist"
34
35
  ],
35
36
  "engines": {
36
- "node": ">=20.19.4"
37
+ "node": ">=20.19.4",
38
+ "runtime": [
39
+ {
40
+ "name": "node",
41
+ "version": "^24.11.0",
42
+ "onFail": "download"
43
+ },
44
+ {
45
+ "name": "bun",
46
+ "version": "^1.3.9",
47
+ "onFail": "download"
48
+ }
49
+ ]
50
+ },
51
+ "dependencies": {
52
+ "node": "runtime:^24.11.0",
53
+ "bun": "runtime:^1.3.9"
37
54
  }
38
55
  }