feat(ccusage): add all-agent coding usage reports#1000
Conversation
Add dependency-free filesystem traversal, JSONL, SQLite, worker, and deprecated CLI wrapper helpers so agent implementations can reuse the ccusage runtime foundation instead of keeping separate copies. Extend terminal rendering with all-agent responsive layouts, stdout-safe writes, shared pricing fetch dedupe, and regression coverage for compact/full table switching in real terminal widths.
Make ccusage daily/monthly/weekly/session aggregate detected coding agents by default, with agent-first namespaces such as ccusage codex daily and ccusage opencode weekly. Keep all-agent rendering on the shared usage table, group rows by period with parent All rows and child agent rows, reject --agent/report flag aliases, and add CLI snapshot coverage for the new contract.
Move Codex, OpenCode, Amp, and pi-agent loading paths away from the old tinyglobby/fast-sort style and onto the shared traversal, JSONL, SQLite, sorting, pricing, and stdout helpers. Preserve agent-specific accounting such as Codex speed pricing, OpenCode JSON plus SQLite inputs, Amp credits, and pi-agent cache reads while aligning dates, offline pricing behaviour, and table output with ccusage.
Convert the companion package entrypoints into compatibility wrappers that depend on ccusage and emit the deprecation path before forwarding to the agent namespace. Keep the existing package binaries, remove obsolete runtime dependencies from the wrapper packages, and update the lockfile so the wrappers stay tiny.
Update user-facing docs for ccusage as the all-agent entrypoint, describe legacy package forwarding, and keep agent-specific examples on the new namespace contract. Record the implementation plan, verification expectations, CodeRabbit/Cubic review loop, performance checks, and cmux terminal capture workflow for visual debugging.
Keep the pi compatibility wrapper in the shape produced by the build tooling so repeated builds do not leave package.json dirty. Use the generated pi binary name when stripping passthrough arguments while continuing to document ccusage-pi as a user alias.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughUnifies agent CLIs under ccusage, adds worker-thread parsing and shared fs/jsonl/sqlite/workers utilities, centralizes/deduplicates pricing fetches, implements an all-agent aggregation command, updates per-agent commands to support --offline and standardized output, extends terminal tables with Agent support and responsive sizing, and updates schema/docs/tests/snapshots. ChangesMulti-Agent Consolidation
🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
ccusage performance comparisonThis compares the PR build against the base branch build on the same CI runner. Committed fixture performanceCommitted small fixture for stable PR-to-PR feedback and output-shape regressions. Fixture:
Large real-world-shaped fixture performanceGenerated fixture around 1 GiB shaped from aggregate local Claude-log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixture. Fixture:
Package size
Lower medians and smaller packed package sizes are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |
@ccusage/amp
ccusage
@ccusage/codex
@ccusage/opencode
@ccusage/pi
commit: |
Remove the environment-derived timezone default from the Codex Gunshi args so generated ccusage config schema no longer depends on the machine timezone. Runtime behavior still falls back through the existing system-timezone path when the option is omitted. Also normalize plan.md spelling to satisfy typos.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ⛔ Deployment terminated View logs |
ccusage-guide | ebfc4cc | May 15 2026, 07:48 PM |
There was a problem hiding this comment.
Actionable comments posted: 18
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/guide/getting-started.md (1)
59-64:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winGeneralize column descriptions to match multi-agent output.
At Line 61-63, wording is still Claude-specific (“Claude models”, “sent to Claude”, “received from Claude”), which conflicts with the new all-agent framing.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/guide/getting-started.md` around lines 59 - 64, The bullets under the usage table are still Claude-specific; update the "Models", "Input", and "Output" lines to neutral, multi-agent wording: change "Which Claude models were used (Sonnet, Opus, etc.)" to "Which models were used (e.g., Sonnet, Opus, Claude, etc.)" and replace "Number of input tokens sent to Claude" / "Number of output tokens received from Claude" with "Number of input tokens sent to the agent/model" and "Number of output tokens received from the agent/model" respectively so the descriptions apply to any agent.
🧹 Nitpick comments (1)
apps/ccusage/src/commands/all.ts (1)
109-125: ⚡ Quick winRemove or wire up
--all.The option is declared in
allArgs, butresolveAllAgents()ignoresoptionsandloadAllRowsWithContext()always loads every agent anyway. Right now the help text promises a mode switch that never happens.Also applies to: 159-162, 681-689
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/ccusage/src/commands/all.ts` around lines 109 - 125, The declared --all flag is unused: modify the command handler so the options object (the boolean at all/ allArgs) is passed into resolveAllAgents() and/or loadAllRowsWithContext() and ensure those functions accept and respect an options.all boolean (or add a parameter like loadAllRowsWithContext(loadAll: boolean)) so that when options.all is true you load every agent and when false you keep the current filtered behavior; alternatively, remove the all flag if you prefer not to support it — update resolveAllAgents(), loadAllRowsWithContext(), and the command invocation sites to consistently read options.all and branch accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/ccusage/config-schema.json`:
- Around line 1013-1017: The JSON schema has timezone defaults set to
"Europe/London" causing CI mismatch; update the default value for the timezone
property (the schema entries whose "description"/"markdownDescription" read
"Timezone for date grouping (IANA)") from "Europe/London" to "UTC" in all
occurrences (including the other two blocks referenced), then regenerate the
schema artifacts by running the project generation command (pnpm run
generate:schema) so docs/public/config-schema.json is updated.
In `@apps/ccusage/src/commands/all.ts`:
- Around line 579-583: The per-row totalTokens currently only sums
event.inputTokens + event.outputTokens and omits Amp cache tokens; update the
accumulation for group.row.totalTokens to also include
event.cacheCreationInputTokens and event.cacheReadInputTokens so totalTokens
reflects input, output, cacheCreationTokens and cacheReadTokens (ensure this
ties to the existing fields group.row.cacheCreationTokens and
group.row.cacheReadTokens and the event properties
cacheCreationInputTokens/cacheReadInputTokens).
In `@apps/ccusage/test/cli-output.test.ts`:
- Line 159: Update the Pi fixture's model ID used in the test—replace the
invalid 'claude-opus-4-5' value with the canonical LiteLLM model ID
'claude-opus-4-20250514' wherever the test sets model: 'claude-opus-4-5' (e.g.,
in the Pi fixture or variable that configures the model in cli-output.test.ts)
so the test uses the correct LiteLLM pricing/database identifier.
In `@apps/codex/package.json`:
- Around line 44-46: Move the "ccusage" entry out of the dependencies section in
package.json and add it under devDependencies instead so the dependencies object
stays empty for the bundled CLI; update the package.json keys (remove "ccusage"
from "dependencies" and add the same version/value under "devDependencies") and
ensure JSON remains valid (keep the exact version "workspace:*" for "ccusage").
In `@apps/codex/README.md`:
- Around line 20-21: The README's alias workflow still recommends the deprecated
wrapper "@ccusage/codex@latest"; update the alias section and all occurrences
(referenced strings "@ccusage/codex@latest" and any other `@ccusage/codex`
mentions) to instead recommend using the non-deprecated invocation ("npx
ccusage@latest codex" or "ccusage codex") so the docs are consistent with the
deprecation notice; search and replace those strings in the README (including
the alias workflow block and the other occurrences called out) and ensure
examples and explanatory text reflect the preferred commands.
In `@apps/opencode/package.json`:
- Around line 47-49: Move the "ccusage" entry out of the dependencies object
into devDependencies in apps/opencode/package.json so runtime deps are bundled;
specifically remove "ccusage": "workspace:*" from the "dependencies" section and
add the same key/value under "devDependencies" (ensure "dependencies" remains
empty or only contains true runtime items per guideline), preserving the version
spec "workspace:*" and package.json JSON validity.
In `@apps/opencode/README.md`:
- Around line 16-17: The README's alias examples still point at the deprecated
package; update any alias and example commands that reference
"@ccusage/opencode" to use the new ccusage-first form (e.g., replace occurrences
of aliases like alias opencode="npx `@ccusage/opencode`" with alias opencode="npx
ccusage@latest opencode" or the equivalent "npx ccusage opencode"), and apply
this change consistently for the sections mentioned (the block around the
compatibility note and the other example ranges). Ensure all displayed example
commands, alias snippets, and prose mention "npx ccusage@latest opencode" (or
"npx ccusage opencode") as the recommended invocation instead of the old
package.
In `@apps/pi/package.json`:
- Around line 56-58: Move the "ccusage" entry out of the dependencies object and
add it under devDependencies with the same version ("workspace:*"); specifically
remove the "ccusage": "workspace:*" line from the dependencies block and insert
it into devDependencies (ensuring there are no duplicate entries), then validate
the package.json is still valid JSON and that the dependencies object is empty
or only contains true runtime deps if any.
In `@apps/pi/README.md`:
- Around line 16-17: Update the alias instructions so they match the new
compatibility-wrapper guidance: replace any recommendations that use the
deprecated package alias like "@ccusage/pi@latest" with the wrapper-first form
"npx ccusage@latest pi" (or instruct using "ccusage pi" if already installed),
and ensure the README sections that mention aliases (the strings
"@ccusage/pi@latest", "ccusage/pi", or similar) are changed in all instances
(around lines referenced) to avoid recommending the deprecated wrapper-first
usage; keep the compatibility note "Prefer npx ccusage@latest pi" as the
canonical example and adjust nearby alias examples to forward to "ccusage pi".
In `@apps/pi/src/data-loader.ts`:
- Around line 259-266: The deduplication key `hash` (built in the loop over
fileResults/entry and stored in processedHashes) is too narrow—replace or widen
it so it includes a unique session identifier in addition to timestamp and
tokenTotal (e.g. include entry.sessionId or entry.session_token or another
per-session unique field on entry) so distinct sessions that share
timestamp+tokenTotal are not collapsed; if no explicit session id exists,
include a second differentiator such as entry.clientId or a short digest of
entry.id/entry metadata (or fallback to JSON.stringify(entry)) when constructing
the hash to ensure per-session uniqueness.
In `@docs/guide/getting-started.md`:
- Line 40: The fenced code block that contains the ASCII table (the block
starting with the box-drawing character '╭') is missing a language tag and
triggers MD040; update the opening fence from ``` to include a language
identifier (e.g., change it to ```text) so the block is explicitly marked as
plain text, preserving the existing block contents and closing fence unchanged.
In `@packages/internal/src/deprecated-agent-cli.ts`:
- Around line 44-48: The wrapper runDeprecatedAgentCli currently lets
resolveCcusageCliPath() rejection propagate; catch errors from
resolveCcusageCliPath() inside runDeprecatedAgentCli and return a numeric
failure code instead of throwing (e.g., return 1). Specifically, wrap the call
to resolveCcusageCliPath() (used to set cliPath) in a try/catch, log or write an
error message via process.stderr (preserving the existing
formatDeprecatedAgentWarning behavior), and return a non-zero exit code when
resolution fails so the function always resolves to a number rather than
rejecting.
In `@packages/internal/src/fs.ts`:
- Around line 17-20: The current try/catch around the readdir call swallows all
errors; change the catch to capture the thrown error (e.g., catch (err)) and
only suppress expected filesystem errors (check err.code against a whitelist
such as 'ENOENT', 'ENOTDIR', and optionally 'EACCES' if intended); for any other
err.code rethrow the error so failures aren't silently dropped. Locate the block
that calls readdir(directory, { withFileTypes: true }) and references entries
and directory, update the catch to inspect err.code and return only for the
allowed codes, otherwise throw err.
In `@packages/internal/src/pricing.ts`:
- Around line 227-234: The memoized pricingLoadPromise in ensurePricingLoaded
makes a failed load permanent; change ensurePricingLoaded so that when
loadPricing() rejects it clears pricingLoadPromise (so subsequent calls can
retry) while still returning the failure; specifically, wrap the Promise
returned by loadPricing() (the value assigned to this.pricingLoadPromise) with a
then/catch that on success sets this.cachedPricing and leaves pricingLoadPromise
as settled, and on error sets this.pricingLoadPromise = undefined before
rethrowing or returning the rejected Result; update references to
ensurePricingLoaded, pricingLoadPromise, loadPricing, cachedPricing (and respect
clearCache behavior) so transient failures are not sticky.
In `@packages/internal/src/workers.ts`:
- Around line 57-61: The function chunkIndexedItemsByFileSize must validate
chunkCount before using it to allocate and index into chunks to avoid runtime
errors when chunkCount is 0 or negative; add an early guard in
chunkIndexedItemsByFileSize that checks if chunkCount is a positive integer
(e.g., throw a RangeError or default to 1) and return or adjust accordingly, and
ensure the same validation is applied to the other chunk-allocation logic that
uses chunks and targetIndex so pushes into chunks[targetIndex] cannot fail due
to an invalid chunkCount.
In `@plan.md`:
- Line 66: Change the British spelling "behaviour" to the American spelling
"behavior" in the plan text — specifically replace "behaviour" (in the sentence
about Agent-specific options and aggregation behaviour) with "behavior" so the
file passes CI spelling checks.
- Line 141: The header "Optimisation Migration Requirements" uses British
spelling; update it to American spelling by renaming the heading to
"Optimization Migration Requirements" so CI passes (locate the header line
containing the exact phrase "Optimisation Migration Requirements" and replace
"Optimisation" with "Optimization").
- Line 154: Fix the American English spelling: update the sentence that
currently reads "When adding missing agent-specific subcommands, design their
cache behaviour at the same time instead of treating caching as a later
bolt-on." by replacing "behaviour" with "behavior" so it becomes "design their
cache behavior" to satisfy CI spelling checks.
---
Outside diff comments:
In `@docs/guide/getting-started.md`:
- Around line 59-64: The bullets under the usage table are still
Claude-specific; update the "Models", "Input", and "Output" lines to neutral,
multi-agent wording: change "Which Claude models were used (Sonnet, Opus, etc.)"
to "Which models were used (e.g., Sonnet, Opus, Claude, etc.)" and replace
"Number of input tokens sent to Claude" / "Number of output tokens received from
Claude" with "Number of input tokens sent to the agent/model" and "Number of
output tokens received from the agent/model" respectively so the descriptions
apply to any agent.
---
Nitpick comments:
In `@apps/ccusage/src/commands/all.ts`:
- Around line 109-125: The declared --all flag is unused: modify the command
handler so the options object (the boolean at all/ allArgs) is passed into
resolveAllAgents() and/or loadAllRowsWithContext() and ensure those functions
accept and respect an options.all boolean (or add a parameter like
loadAllRowsWithContext(loadAll: boolean)) so that when options.all is true you
load every agent and when false you keep the current filtered behavior;
alternatively, remove the all flag if you prefer not to support it — update
resolveAllAgents(), loadAllRowsWithContext(), and the command invocation sites
to consistently read options.all and branch accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e06007bc-8da2-43f9-b4e8-bf0580f1a02d
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (58)
apps/amp/package.jsonapps/amp/src/_macro.tsapps/amp/src/commands/daily.tsapps/amp/src/commands/monthly.tsapps/amp/src/commands/session.tsapps/amp/src/data-loader.tsapps/amp/src/index.tsapps/amp/src/pricing.tsapps/ccusage/README.mdapps/ccusage/config-schema.jsonapps/ccusage/scripts/bench.mjsapps/ccusage/src/commands/all.tsapps/ccusage/src/commands/index.tsapps/ccusage/test/cli-output.test.tsapps/ccusage/test/snapshots/cli-output/daily-json.txtapps/ccusage/test/snapshots/cli-output/daily-table.txtapps/ccusage/test/snapshots/cli-output/monthly-json.txtapps/ccusage/test/snapshots/cli-output/session-json.txtapps/ccusage/test/snapshots/cli-output/session-table.txtapps/ccusage/test/snapshots/cli-output/weekly-json.txtapps/ccusage/tsdown.config.tsapps/codex/README.mdapps/codex/package.jsonapps/codex/src/command-utils.tsapps/codex/src/daily-report.tsapps/codex/src/data-loader.tsapps/codex/src/index.tsapps/codex/src/monthly-report.tsapps/codex/src/pricing.tsapps/opencode/README.mdapps/opencode/package.jsonapps/opencode/src/commands/daily.tsapps/opencode/src/commands/monthly.tsapps/opencode/src/commands/session.tsapps/opencode/src/commands/weekly.tsapps/opencode/src/data-loader.tsapps/opencode/src/index.tsapps/pi/README.mdapps/pi/package.jsonapps/pi/src/commands/daily.tsapps/pi/src/commands/monthly.tsapps/pi/src/commands/session.tsapps/pi/src/data-loader.tsapps/pi/src/index.tsdocs/guide/codex/index.mddocs/guide/getting-started.mddocs/guide/index.mdpackages/internal/package.jsonpackages/internal/src/array.tspackages/internal/src/deprecated-agent-cli.tspackages/internal/src/fs.tspackages/internal/src/jsonl.tspackages/internal/src/logger.tspackages/internal/src/pricing.tspackages/internal/src/sqlite.tspackages/internal/src/workers.tspackages/terminal/src/table.tsplan.md
There was a problem hiding this comment.
13 issues found across 59 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/amp/src/commands/daily.ts">
<violation number="1" location="apps/amp/src/commands/daily.ts:204">
P2: The leading `\n` in the message string breaks the tagged line format — `writeTaggedLine` already emits a blank line before the tag, so the extra newline splits the tag prefix from the message content. Remove the leading `\n` to keep the tagged output on one line.</violation>
</file>
<file name="apps/ccusage/config-schema.json">
<violation number="1" location="apps/ccusage/config-schema.json:429">
P2: Type mismatch: `contextLowThreshold` and `contextMediumThreshold` are declared as `"type": "string"` but have numeric `default` values (50 and 80). Either change the type to `"number"` or make the defaults string values (`"50"`, `"80"`). Since they represent numeric percentages, `"type": "number"` is likely correct.</violation>
</file>
<file name="apps/pi/README.md">
<violation number="1" location="apps/pi/README.md:16">
P2: The shell alias section immediately below still uses the deprecated `@ccusage/pi@latest` package. Update it to use `ccusage@latest pi` to stay consistent with the deprecation notice and the rest of this file.</violation>
</file>
<file name="apps/pi/package.json">
<violation number="1" location="apps/pi/package.json:27">
P2: Binary name `pi` is too generic and inconsistent with sibling packages (`ccusage-amp`, `ccusage-codex`, `ccusage-opencode`). Publishing an npm package with a `pi` binary risks name collisions with other tools. Consider keeping the `ccusage-pi` name for the binary, even if the package is deprecated.</violation>
</file>
<file name="packages/internal/src/sqlite.ts">
<violation number="1" location="packages/internal/src/sqlite.ts:80">
P2: The replacement `process.emitWarning` function only forwards the first argument. If a non-SQLite warning fires during the require with extra arguments (type, code, ctor), they are silently dropped. Use rest parameters to forward all arguments for non-suppressed warnings.</violation>
</file>
<file name="packages/internal/src/jsonl.ts">
<violation number="1" location="packages/internal/src/jsonl.ts:63">
P2: When running on Bun and the file exceeds `MAX_BUFFERED_JSONL_BYTES`, the Bun branch doesn't return `null`, causing a redundant fallthrough to the Node.js path that re-opens and re-stats the file. Add `return null` after the Bun size check to short-circuit.</violation>
</file>
<file name="apps/ccusage/src/commands/all.ts">
<violation number="1" location="apps/ccusage/src/commands/all.ts:583">
P2: Amp `totalTokens` excludes cache tokens, inconsistent with all other agents. This causes the aggregated "All" row totals to undercount when Amp has cache usage.</violation>
</file>
<file name="apps/amp/src/commands/session.ts">
<violation number="1" location="apps/amp/src/commands/session.ts:216">
P2: The leading `\n` in the message breaks the tagged log format. `writeTaggedLine` already outputs a blank line before the tag, so the embedded `\n` creates an extra blank line and causes "Running in Compact Mode" to appear on a new line without the logger prefix.</violation>
</file>
<file name="packages/internal/src/fs.ts">
<violation number="1" location="packages/internal/src/fs.ts:3">
P2: Move the `fs-fixture` import inside the `import.meta.vitest` guard to avoid bundling a test-only dependency into production. Unlike Node.js built-ins used elsewhere in this package, `fs-fixture` is an external test package whose tree-shaking depends on the production bundler proving it's side-effect-free.</violation>
</file>
<file name="packages/terminal/src/table.ts">
<violation number="1" location="packages/terminal/src/table.ts:854">
P2: `compactHeaders.indexOf('Models')` returns `-1` when `includeAgent` is true (compact headers are `['Date', 'Agent', 'Total Tokens', 'Cost (USD)']`). This `-1` passes downstream as a valid `flexibleColumnIndex`, triggering dead computation and fragile index lookups like `columnWidths[-1]`. Normalize to `undefined` when the header isn't found.</violation>
</file>
<file name="packages/internal/src/pricing.ts">
<violation number="1" location="packages/internal/src/pricing.ts:232">
P1: Reset `pricingLoadPromise` on failed pricing loads so transient fetch errors can recover on subsequent calls.</violation>
</file>
<file name="packages/internal/src/deprecated-agent-cli.ts">
<violation number="1" location="packages/internal/src/deprecated-agent-cli.ts:47">
P2: Handle `resolveCcusageCliPath()` failures inside the wrapper and return a non-zero exit code. Letting this throw causes the wrapper to reject instead of consistently returning an exit status.</violation>
</file>
<file name="apps/pi/src/data-loader.ts">
<violation number="1" location="apps/pi/src/data-loader.ts:261">
P1: The dedup key is too coarse; distinct pi-agent events with the same timestamp and total token count will be merged and dropped. Include stable identifiers (for example project/session/model/token components) in the hash so valid usage rows are not lost.</violation>
</file>
Tip: instead of fixing issues one by one fix them all with cubic
Partial review: This PR has more than 50 files, so cubic reviewed the highest-priority files first. During the trial, paid plans get a higher file limit.
You can try an ultrareview to bypass the file limit, comment @cubic-dev-ai ultrareview. Learn more.
Re-trigger cubic
Include Amp cache tokens in all-agent totals, widen pi-agent deduplication keys, and harden shared wrapper/fs/worker/pricing helpers. Also updates docs examples to point aliases at the ccusage-first commands and refreshes schema metadata.
Remove extra compact-mode newlines from Amp logs, make statusline threshold schema numeric, avoid bundling fs-fixture in internal fs tests, short-circuit large Bun JSONL reads, forward process.emitWarning arguments, and normalize missing flexible table column indexes.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/pi/src/data-loader.ts`:
- Line 529: The test is using the deprecated model name `claude-opus-4-5` under
the `usage` object; update that string to one of the approved Claude 4 names
(`claude-sonnet-4-20250514` or `claude-opus-4-20250514`) and then adjust the
corresponding expected assertion (the assertion near the original line 559) to
match the new model name so the test expectation aligns with LiteLLM's pricing
database entry; locate the `usage` object in apps/pi/src/data-loader.ts and the
nearby assertion referencing the model and update both accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 65afa892-5a22-49a7-a9c3-8d37040b6891
📒 Files selected for processing (14)
apps/ccusage/config-schema.jsonapps/ccusage/src/commands/all.tsapps/ccusage/test/cli-output.test.tsapps/codex/README.mdapps/codex/src/_shared-args.tsapps/opencode/README.mdapps/pi/README.mdapps/pi/src/data-loader.tsdocs/guide/getting-started.mdpackages/internal/src/deprecated-agent-cli.tspackages/internal/src/fs.tspackages/internal/src/pricing.tspackages/internal/src/workers.tsplan.md
💤 Files with no reviewable changes (1)
- apps/codex/src/_shared-args.ts
✅ Files skipped from review due to trivial changes (3)
- apps/pi/README.md
- apps/opencode/README.md
- docs/guide/getting-started.md
🚧 Files skipped from review as they are similar to previous changes (7)
- packages/internal/src/pricing.ts
- packages/internal/src/deprecated-agent-cli.ts
- packages/internal/src/fs.ts
- packages/internal/src/workers.ts
- apps/ccusage/config-schema.json
- apps/ccusage/test/cli-output.test.ts
- apps/ccusage/src/commands/all.ts
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
apps/ccusage/src/commands/statusline.ts (1)
157-158: ⚡ Quick winUse the parsed thresholds for rendering, not raw
ctx.values.Line 157 and Line 158 validate/normalize thresholds, but Line 464 and Line 466 still read raw values. Reuse
contextLowThreshold/contextMediumThresholdinformatContextInfoso validation and rendering stay consistent.♻️ Proposed fix
-const formatContextInfo = (inputTokens: number, contextLimit: number): string => { +const formatContextInfo = ( + inputTokens: number, + contextLimit: number, + lowThreshold: number, + mediumThreshold: number, +): string => { const percentage = Math.round((inputTokens / contextLimit) * 100); const color = - percentage < ctx.values.contextLowThreshold + percentage < lowThreshold ? pc.green - : percentage < ctx.values.contextMediumThreshold + : percentage < mediumThreshold ? pc.yellow : pc.red; const coloredPercentage = color(`${percentage}%`); const tokenDisplay = inputTokens.toLocaleString(); return `${tokenDisplay} (${coloredPercentage})`; }; @@ - return formatContextInfo(contextResult.inputTokens, contextResult.contextLimit); + return formatContextInfo( + contextResult.inputTokens, + contextResult.contextLimit, + contextLowThreshold, + contextMediumThreshold, + );Also applies to: 461-468, 500-505
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/ccusage/src/commands/statusline.ts` around lines 157 - 158, The code parses/normalizes thresholds into contextLowThreshold and contextMediumThreshold but still uses raw ctx.values.contextLowThreshold / ctx.values.contextMediumThreshold when rendering; update formatContextInfo (and all other spots in StatusLine where thresholds are read e.g., the blocks around the other occurrences) to use the parsed variables contextLowThreshold and contextMediumThreshold instead of ctx.values.* so the validated values are rendered consistently (search for usages in formatContextInfo and the sections around the other occurrences and replace with the parsed symbol names).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plan.md`:
- Around line 1-5: The document's main heading "Plan: Consolidate Agent Usage
CLIs into ccusage" is missing the required screenshot immediately after the H1;
add an image reference right after that H1 (using markdown image syntax)
pointing to the appropriate screenshot file (e.g., a new or existing file like
assets/images/ccusage-overview.png), include an informative alt text and brief
caption, and ensure the image path matches the repo's docs/assets location so it
renders in previews.
- Around line 807-823: The example in plan.md hardcodes machine-specific IDs
(workspace_id, surface_id, pane_id) and an absolute user path; update the
snippet to use placeholders/env vars (e.g., WORKSPACE_REF, SURFACE_REF,
PANE_REF, WORKSPACE_ID, SURFACE_ID, PANE_ID, PROJECT_DIR) and show how to
substitute them in the commands so the cmux send and cmux capture-pane lines
reference variables instead of literal IDs or /Users/... paths; locate the
workspace_ref/pane_ref/surface_ref and the cmux send/capture-pane command lines
and replace the concrete IDs and the /Users/... project path with those
placeholders and a short note to set the env vars before running.
---
Nitpick comments:
In `@apps/ccusage/src/commands/statusline.ts`:
- Around line 157-158: The code parses/normalizes thresholds into
contextLowThreshold and contextMediumThreshold but still uses raw
ctx.values.contextLowThreshold / ctx.values.contextMediumThreshold when
rendering; update formatContextInfo (and all other spots in StatusLine where
thresholds are read e.g., the blocks around the other occurrences) to use the
parsed variables contextLowThreshold and contextMediumThreshold instead of
ctx.values.* so the validated values are rendered consistently (search for
usages in formatContextInfo and the sections around the other occurrences and
replace with the parsed symbol names).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c28303c4-0680-4375-852d-c811840723a2
📒 Files selected for processing (13)
.agents/skills/cmux-debug.claude/skills/cmux-debug/SKILL.mdapps/amp/src/commands/daily.tsapps/amp/src/commands/session.tsapps/ccusage/config-schema.jsonapps/ccusage/src/commands/statusline.tsapps/pi/src/_pi-agent.tsapps/pi/src/data-loader.tspackages/internal/src/fs.tspackages/internal/src/jsonl.tspackages/internal/src/sqlite.tspackages/terminal/src/table.tsplan.md
✅ Files skipped from review due to trivial changes (2)
- .claude/skills/cmux-debug/SKILL.md
- apps/pi/src/_pi-agent.ts
🚧 Files skipped from review as they are similar to previous changes (8)
- packages/internal/src/fs.ts
- apps/amp/src/commands/session.ts
- packages/internal/src/sqlite.ts
- apps/amp/src/commands/daily.ts
- apps/pi/src/data-loader.ts
- apps/ccusage/config-schema.json
- packages/internal/src/jsonl.ts
- packages/terminal/src/table.ts
Switch responsive tables to prefer compact output when the full layout would consume nearly all available terminal width, while still allowing wide terminals to keep the detailed columns. Shorten wrapped Claude model names from agent integrations so the models column does not dominate tables. Move Amp report headers before pricing work, include cache tokens in Amp totals, and add CLI integration snapshots for all-agent and direct agent outputs. Document that human-readable CLI integration output needs file snapshots and that Vitest tests should use vi.stubEnv for env changes.
There was a problem hiding this comment.
1 issue found across 18 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/ccusage/test/snapshots/cli-output/all-agent-daily-json.txt">
<violation number="1" location="apps/ccusage/test/snapshots/cli-output/all-agent-daily-json.txt:16">
P2: `totalTokens` is inconsistent with the token component fields (should be 700), which bakes an incorrect expected JSON contract into the snapshot.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic
Re-trigger cubic
Remove the unconditional blank line before tagged log lines so pricing and compact-mode notices render as adjacent terminal lines. Add a tiny internal ANSI color helper instead of depending on picocolors for logger labels; info follows consola cyan, warn uses yellow, errors use red, and tags use gray. Render compact-mode notices before table output for agent report commands so snapshots and terminal output keep the notice attached to the resulting table.
There was a problem hiding this comment.
2 issues found across 19 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/internal/src/logger.ts">
<violation number="1" location="packages/internal/src/logger.ts:161">
P2: This test is environment-dependent: it expects plain text even though color output is enabled on TTY/`FORCE_COLOR`. Make the test force `NO_COLOR` (and restore env) so it remains deterministic.</violation>
</file>
<file name="packages/internal/src/ansi-colors.ts">
<violation number="1" location="packages/internal/src/ansi-colors.ts:7">
P2: `NO_COLOR` handling is too aggressive and currently blocks forced color. Empty `NO_COLOR` should be ignored, and `FORCE_COLOR` should be evaluated first so explicit force settings can take effect.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic
Re-trigger cubic
Use the rendered table border width when deciding whether a table fits instead of over-counting each column separator. This prevents full layouts from falling into compact mode when the terminal is wide enough. Measure multiline cells by the widest rendered line rather than the full newline-delimited string, which keeps model columns from expanding unnecessarily for multi-model rows. Move compact mode notices below rendered tables across agent commands so the report stays visually grouped while retaining the warning.
|
You're iterating quickly on this pull request. To help protect your rate limits, cubic has paused automatic reviews on new pushes for now—when you're ready for another review, comment |
|
@coderabbitai review\n@cubic-dev-ai review |
|
✅ Actions performedReview triggered.
|
|
@cubic-dev-ai review |
@ryoppippi I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (2)
apps/codex/package.json (1)
44-46:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winMove
ccusagetodevDependencies.This issue was previously flagged but not addressed. Codex ships as a bundled CLI where all runtime dependencies must be in
devDependencies. Thedependenciessection should remain empty so the bundler owns the runtime payload.📦 Proposed fix
- "dependencies": { - "ccusage": "workspace:*" - }, "devDependencies": { "@ccusage/internal": "workspace:*", "@ccusage/terminal": "workspace:*", "@praha/byethrow": "catalog:runtime", "@ryoppippi/eslint-config": "catalog:lint", "@typescript/native-preview": "catalog:types", + "ccusage": "workspace:*", "clean-pkg-json": "catalog:release",As per coding guidelines: "Package Codex as a bundled CLI and keep every runtime dependency in devDependencies so the bundle includes shipped code" and "All projects under apps/ ship as bundled CLIs/binaries. Treat their runtime dependencies as bundled assets: list everything in each app's devDependencies (never dependencies)."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/codex/package.json` around lines 44 - 46, Move the "ccusage" entry from the package.json "dependencies" section into "devDependencies" and ensure the "dependencies" object is left empty; update the package.json so that "ccusage": "workspace:*" appears under "devDependencies" (not "dependencies") to comply with the bundled-CLI rule for the Codex app.apps/opencode/package.json (1)
47-49:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winMove
ccusagetodevDependenciesper coding guidelines.OpenCode is packaged as a bundled CLI where all runtime dependencies must be in
devDependencies. Thedependenciessection should remain empty so the bundler owns the runtime payload.📦 Proposed fix
- "dependencies": { - "ccusage": "workspace:*" - }, "devDependencies": { "@ccusage/internal": "workspace:*", "@ccusage/terminal": "workspace:*", "@praha/byethrow": "catalog:runtime", "@ryoppippi/eslint-config": "catalog:lint", "@typescript/native-preview": "catalog:types", + "ccusage": "workspace:*", "clean-pkg-json": "catalog:release",As per coding guidelines: "Keep every runtime dependency in
devDependenciesbecause OpenCode is packaged as a bundled CLI" and "All projects underapps/ship as bundled CLIs/binaries. Treat their runtime dependencies as bundled assets: list everything in each app'sdevDependencies(neverdependencies)."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/opencode/package.json` around lines 47 - 49, Move the "ccusage" entry out of the "dependencies" object and add it under "devDependencies" in apps/opencode's package.json (update the "ccusage" version string exactly as currently listed), leaving "dependencies" empty so the bundled CLI follows the repo guideline; ensure package.json remains valid JSON (no duplicate keys) and run the package manager install to update lockfiles if needed.
🧹 Nitpick comments (1)
packages/internal/src/colors.ts (1)
26-56: 💤 Low valueConsider adding JSDoc comments to exported utility functions.
The exported color formatter functions would benefit from brief JSDoc comments explaining their purpose and parameters, especially the optional
streamparameter.📝 Example JSDoc
+/** + * Apply cyan color formatting to text when color output is enabled. + * `@param` value - The text to format + * `@param` stream - Optional output stream (defaults to stdout) + * `@returns` The formatted text (or original text if color is disabled) + */ export function cyan(value: string, stream?: WriteStream): string { return colorize('cyan', value, stream); }Based on learnings: "Utility functions should include JSDoc explaining their purpose" (packages/internal guideline).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/internal/src/colors.ts` around lines 26 - 56, Add concise JSDoc comments to each exported color helper (blue, bold, cyan, dim, gray, green, red, yellow) describing that they format the input string with the given color/style and return the formatted string; document the parameters: value (string) and optional stream (WriteStream) which selects whether to apply coloring, and mention the return type (string); note that these helpers delegate to colorize so reference colorize in the description and ensure tags (`@param`, `@returns`) are present for each function.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/terminal/package.json`:
- Line 18: The package.json currently lists "@ccusage/internal": "workspace:*"
under dependencies; move that entry into devDependencies instead (preserve the
version "workspace:*"), removing it from dependencies and adding it to
devDependencies in the packages/terminal package.json, then reinstall or update
the lockfile so the change is reflected; verify no runtime imports require it to
remain a dependency before committing.
In `@packages/terminal/src/table.ts`:
- Around line 314-320: The compact-mode condition is inconsistent: code that
returns compact table config checks both this.compactHead and
this.compactColAligns, but elsewhere compact is activated by this.compactHead
alone, causing headers to stay full while rows are compact-filtered and misalign
columns; unify the checks so compact mode is enabled only when both header and
column alignment info exist (or change all checks to rely solely on
this.compactHead), and update the logic that builds compact rows/filtering to
use the same condition; specifically adjust the checks around compactMode,
compactHead, compactColAligns, compactMinColumnWidths and
compactFlexibleColumnIndex and the code that generates compact-filtered rows so
they all use the identical predicate to decide compact mode.
---
Duplicate comments:
In `@apps/codex/package.json`:
- Around line 44-46: Move the "ccusage" entry from the package.json
"dependencies" section into "devDependencies" and ensure the "dependencies"
object is left empty; update the package.json so that "ccusage": "workspace:*"
appears under "devDependencies" (not "dependencies") to comply with the
bundled-CLI rule for the Codex app.
In `@apps/opencode/package.json`:
- Around line 47-49: Move the "ccusage" entry out of the "dependencies" object
and add it under "devDependencies" in apps/opencode's package.json (update the
"ccusage" version string exactly as currently listed), leaving "dependencies"
empty so the bundled CLI follows the repo guideline; ensure package.json remains
valid JSON (no duplicate keys) and run the package manager install to update
lockfiles if needed.
---
Nitpick comments:
In `@packages/internal/src/colors.ts`:
- Around line 26-56: Add concise JSDoc comments to each exported color helper
(blue, bold, cyan, dim, gray, green, red, yellow) describing that they format
the input string with the given color/style and return the formatted string;
document the parameters: value (string) and optional stream (WriteStream) which
selects whether to apply coloring, and mention the return type (string); note
that these helpers delegate to colorize so reference colorize in the description
and ensure tags (`@param`, `@returns`) are present for each function.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a22f2100-2a08-4581-a545-f3101040c540
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (46)
CLAUDE.mdapps/amp/package.jsonapps/amp/src/commands/daily.tsapps/amp/src/commands/monthly.tsapps/amp/src/commands/session.tsapps/ccusage/package.jsonapps/ccusage/src/_shared-args.tsapps/ccusage/src/commands/all.tsapps/ccusage/src/commands/blocks.tsapps/ccusage/src/commands/daily.tsapps/ccusage/src/commands/monthly.tsapps/ccusage/src/commands/session.tsapps/ccusage/src/commands/statusline.tsapps/ccusage/src/commands/weekly.tsapps/ccusage/test/cli-output.test.tsapps/ccusage/test/snapshots/cli-output/all-agent-daily-json.txtapps/ccusage/test/snapshots/cli-output/all-agent-daily-table.txtapps/ccusage/test/snapshots/cli-output/amp-direct-compact-table.txtapps/ccusage/test/snapshots/cli-output/amp-direct-daily-json.txtapps/ccusage/test/snapshots/cli-output/amp-direct-full-table.txtapps/ccusage/test/snapshots/cli-output/blocks-table.txtapps/ccusage/test/snapshots/cli-output/codex-direct-daily-json.txtapps/ccusage/test/snapshots/cli-output/daily-table.txtapps/ccusage/test/snapshots/cli-output/opencode-direct-daily-json.txtapps/ccusage/test/snapshots/cli-output/session-table.txtapps/codex/package.jsonapps/codex/src/_shared-args.tsapps/codex/src/commands/daily.tsapps/codex/src/commands/monthly.tsapps/codex/src/commands/session.tsapps/opencode/package.jsonapps/opencode/src/commands/daily.tsapps/opencode/src/commands/monthly.tsapps/opencode/src/commands/session.tsapps/opencode/src/commands/weekly.tsapps/pi/package.jsonapps/pi/src/commands/daily.tsapps/pi/src/commands/monthly.tsapps/pi/src/commands/session.tspackages/internal/package.jsonpackages/internal/src/colors.tspackages/internal/src/logger.tspackages/terminal/CLAUDE.mdpackages/terminal/package.jsonpackages/terminal/src/table.tsplan.md
💤 Files with no reviewable changes (1)
- apps/ccusage/package.json
✅ Files skipped from review due to trivial changes (10)
- apps/ccusage/test/snapshots/cli-output/all-agent-daily-json.txt
- packages/terminal/CLAUDE.md
- apps/ccusage/test/snapshots/cli-output/codex-direct-daily-json.txt
- apps/ccusage/test/snapshots/cli-output/amp-direct-compact-table.txt
- apps/ccusage/test/snapshots/cli-output/opencode-direct-daily-json.txt
- apps/ccusage/test/snapshots/cli-output/amp-direct-full-table.txt
- apps/ccusage/test/snapshots/cli-output/amp-direct-daily-json.txt
- apps/ccusage/src/_shared-args.ts
- apps/ccusage/test/snapshots/cli-output/session-table.txt
- apps/ccusage/test/snapshots/cli-output/daily-table.txt
🚧 Files skipped from review as they are similar to previous changes (8)
- apps/amp/package.json
- packages/internal/package.json
- apps/opencode/src/commands/session.ts
- apps/codex/src/_shared-args.ts
- apps/opencode/src/commands/weekly.ts
- apps/ccusage/src/commands/statusline.ts
- apps/pi/package.json
- apps/opencode/src/commands/monthly.ts
Add TTY-only per-agent progress indicators while the all report loads agent logs. JSON output keeps suppressing progress and logger output so automation receives clean structured data. The all command now detects visible agents once before rendering, reuses that set for table loading, and reports row counts before the responsive table is printed.
|
@coderabbitai review |
@ryoppippi I have started the AI code review. It will take a few minutes to complete. |
|
✅ Actions performedReview triggered.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Use compact headers as the single compact-mode predicate and synthesize left alignment when compact column alignments are omitted. This prevents rows from being compact-filtered while full headers remain active. Move @ccusage/internal to terminal devDependencies to match the bundled workspace dependency policy.
|
@coderabbitai review |
|
✅ Actions performedReview triggered.
|
@ryoppippi I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/terminal/package.json (1)
17-20: ⚡ Quick winConsider moving remaining dependencies to
devDependenciesper repo guidelines.The coding guideline states that dependencies should always be added as
devDependenciesunless explicitly requested otherwise. While@ccusage/internalwas correctly moved todevDependenciesin this PR, two dependencies remain in thedependenciesblock:
@oxc-project/runtime(catalog:build)ansi-escapes(catalog:runtime)Since this is a private package that exports TypeScript source files and follows a bundled workspace dependency policy, consider moving these to
devDependenciesin a follow-up change for full guideline compliance.As per coding guidelines: "
**/package.json: Dependencies should always be added as devDependencies unless explicitly requested otherwise."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/terminal/package.json` around lines 17 - 20, The package.json currently lists `@oxc-project/runtime` and ansi-escapes under "dependencies"; move these two entries into "devDependencies" to comply with the repo guideline that non-runtime/private workspace packages be declared as devDependencies—update the "dependencies" object to remove "@oxc-project/runtime" and "ansi-escapes" and add them (with the same version specs "catalog:build" and "catalog:runtime") to the "devDependencies" object in the same package.json so tools/readers can find them under devDependencies.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/terminal/package.json`:
- Around line 17-20: The package.json currently lists `@oxc-project/runtime` and
ansi-escapes under "dependencies"; move these two entries into "devDependencies"
to comply with the repo guideline that non-runtime/private workspace packages be
declared as devDependencies—update the "dependencies" object to remove
"@oxc-project/runtime" and "ansi-escapes" and add them (with the same version
specs "catalog:build" and "catalog:runtime") to the "devDependencies" object in
the same package.json so tools/readers can find them under devDependencies.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 883c1ce3-b402-4a1d-a6a7-2ea6f41d331b
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
packages/terminal/package.jsonpackages/terminal/src/table.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/terminal/src/table.ts
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/terminal/package.json">
<violation number="1" location="packages/terminal/package.json:22">
P2: `@ccusage/internal` is used by exported runtime code, so it should remain a regular dependency instead of a devDependency.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic
Re-trigger cubic
Summary
ccusageas the defaultccusage/ccusage dailyexperience.ccusage codex daily,ccusage opencode weekly,ccusage amp session, andccusage pi daily.--agentout of the CLI contract and reject report flag aliases like--daily.ccusageand print deprecation guidance.Allrows and per-agent child rows, plus responsive full/compact table fallback.cmux-debugskill and keep the cmux workflow inplan.mdusing portable placeholders.Notes
--offlineis forwarded through agent namespaces and avoids LiteLLM fetches in smoke tests.all/ all-agent;--agentwas not added.Bundle size
pnpm run buildreportsapps/ccusagebundled JS at 131.12 KB main + 77.17 KB data-loader, with sourcemap-heavy local dist at 1.55 MB total.npm pack --json --dry-runforapps/ccusage: 63,225 bytes packed / 281,505 bytes unpacked / 12 entries.Local smoke timings
Built CLI, local real data, offline JSON output:
./dist/cli.js --offline --json --since 20260514 --until 20260515: 21.06s real./dist/cli.js codex --offline --json --since 20260514 --until 20260515: 25.02s real./dist/cli.js opencode --offline --json: 0.21s real./dist/cli.js amp --offline --json: 0.10s real./dist/cli.js pi --offline --json: 0.11s realThe Codex/all timings are dominated by the large local Codex history on this machine.
Verification
Latest local verification on this branch:
pnpm vitest run packages/internal/src/logger.ts apps/ccusage/test/cli-output.test.ts: passpnpm vitest run packages/terminal/src/table.ts: passpnpm vitest run apps/ccusage/test/cli-output.test.ts -u: passpnpm run format: passpnpm typecheck: passpnpm run test: 430 passed, 1 skipped (431 total)pnpm run build: pass./dist/cli.js ampat 145 columnsLatest PR checks on GitHub:
Review notes
Actionable CodeRabbit and Cubic comments have been reviewed against the current code. Valid issues were fixed in follow-up commits; intentionally skipped items were stale or not applicable to this implementation plan.
Summary by CodeRabbit
New Features
Improvements
Documentation