Skip to content

fix(nix): stabilise crane dependency cache - #1243

Merged
ryoppippi merged 10 commits into
mainfrom
fix/nix-crane-deps-cache
Jun 10, 2026
Merged

ryoppippi merged 10 commits into
mainfrom
fix/nix-crane-deps-cache

Conversation

@ryoppippi

@ryoppippi ryoppippi commented Jun 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Stabilises the crane dependency artifact so Rust dependency caching is not invalidated by unrelated release version bumps or LiteLLM pricing input updates.

What Changed

  • Adds deps-only crane arguments that remove `CCUSAGE_PRICING_JSON_PATH` and use a stable version.
  • Reuses the deps-only arguments for static Linux builds so package variants behave consistently.

Testing

  • `nix fmt -- package.nix nix/static-package.nix`
  • `nix build .#ccusage --print-build-logs`
  • `nix build .#ccusage --dry-run --print-out-paths`

Summary by cubic

Stabilizes the crane dependency cache so Rust deps don’t rebuild on release bumps or pricing snapshot changes, and splits dev tooling into a separate flake to keep packages lean and CI caching predictable. Builds both macOS binaries with Nix and fixes single‑user Nix ownership on non‑Windows cache restores.

  • Strips CCUSAGE_PRICING_JSON_PATH from deps-only builds and pins the deps artifact version to 0.0.0; exposes depsOnlyArgs and reuses it for static builds so both share a stable cache key.

  • Adds comments in package.nix and nix/static-package.nix explaining the stable deps cache key.

  • Refactors

    • Moves dev-only modules to dev/flake.nix; .envrc now uses use flake ./dev; adds a ./dev#ci shell.
    • Switches to nixbuild/nix-quick-install-action, splits package vs dev cache profiles, and makes dev-shell warming optional.
    • Chowns /nix/var/log/nix and /nix/var/nix on non‑Windows before builds; stops chown‑ing /nix/store to avoid lock permission issues.
    • Builds macOS arm64 and x64 packages via Nix in CI and release (Cargo remains for Windows); updates artifact path to result/bin/ccusage.
    • Updates workflows to run flake checks via just flake-check, use nix develop ./dev#ci, and call shared just tasks (install, generate-large-fixture); typecheck now depends on a frozen pnpm install.

Written for commit 6157464. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added CLI recipes: install (pnpm install) and generate-large-fixture for large PR benchmark generation.
  • Chores

    • Introduced a dedicated dev environment and CI dev shell; CI and release workflows now run under that environment and include an improved cache-profile option and optional warm dev-shell step.
    • Added a macOS native build step and standardized native build outputs.
    • Updated dev reload/watch and formatting/schema commands to target the new dev environment.

Build dependency artifacts no longer inherit the LiteLLM pricing JSON path, which changes when the pinned pricing input is updated even though Cargo dependencies remain the same.

Use a stable deps-only package version so release version bumps do not force a fresh dependency artifact. Reuse those deps-only arguments for static Linux builds to keep the caching behaviour consistent across package variants.
@coderabbitai

coderabbitai Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5b8b8a36-8e6b-4fd0-bd1f-e7ed3d3cd946

📥 Commits

Reviewing files that changed from the base of the PR and between 537f76b and 6157464.

📒 Files selected for processing (2)
  • .github/workflows/ci.yaml
  • justfile
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yaml

📝 Walkthrough

Walkthrough

Split dependency-only crate build args: package.nix defines depsOnlyArgs (removes pricing path, pins version) and exports it; nix/static-package.nix consumes that export to compute static deps artifacts. Add dev/flake.nix, route dev commands and CI through ./dev#ci, and update the Nix setup action caching and dev-shell wiring.

Changes

Nix build dependency isolation via depsOnlyArgs

Layer / File(s) Summary
Main package depsOnlyArgs introduction and export
package.nix
depsOnlyArgs is created from commonArgs by removing CCUSAGE_PRICING_JSON_PATH and forcing version = "0.0.0", then used to build cargoArtifacts via craneLib.buildDepsOnly and exported in passthru.
Static package depsOnlyArgs consumption
nix/static-package.nix
staticDepsOnlyArgs derives from config.packages.ccusage.passthru.depsOnlyArgs, overlays static-target cargoExtraArgs, sets nativeBuildInputs to include pkg-config from staticPkgs, clears buildInputs, and uses it to compute staticCargoArtifacts.

Dev flake, dev-shell and CI wiring

Layer / File(s) Summary
Setup action inputs and cache keys
.github/actions/setup-nix/action.yaml
Adds cache-profile and warm-dev-shell inputs, switches to nixbuild/nix-quick-install-action with nix_conf, splits cache restore/purge into package vs dev keyed steps, and adds a non-Windows store ownership fix step.
Workflows: run via ./dev#ci and use dev cache-profile
.github/workflows/*
Update CI/release/update-pricing workflows to pass cache-profile: dev, run install/commands via nix develop ./dev#ci, add nix flake check ./dev, adjust native build steps and artifact paths, and route publish/fixture/perf tasks through ./dev#ci.
dev/flake.nix and flake.nix imports
dev/flake.nix, flake.nix
Add dev/flake.nix with local dev outputs and module wiring; simplify root flake.nix inputs/imports to local nix/* modules and add flake-parts touchup module while disabling formatter touchup.
Dev-shell refactor and new CI dev shell
nix/dev-shell.nix
Introduce shared devShellPackages, refactor default shell to use it, and add devShells.ci for CI dev shell usage.
justfile, treefmt, checks, agent-skills, .envrc
justfile, nix/treefmt.nix, nix/checks.nix, nix/agent-skills.nix, .envrc
Add install and generate-large-fixture just tasks; route fmt/check/schema via ./dev#ci; set treefmt.projectRoot and local root usages; update schema regeneration hints to use nix run ./dev#generate-schema; update direnv to watch dev/flake.nix and dev/flake.lock.

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • pullfrog

Poem

🐰 A rabbit nibbles Nix with cheer,

Splitting deps to keep builds clear,
Dev flakes hum and CI aligns,
Cache keys march in tidy lines,
Hoppity hop — the workflows cheer!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(nix): stabilise crane dependency cache' is concise, clear, and directly reflects the main objective of stabilising the crane dependency artifact to prevent cache invalidation from unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/nix-crane-deps-cache

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ccusage-guide 6157464 Commit Preview URL

Branch Preview URL
Jun 10 2026, 11:18 AM

Document why the dependency-only crane arguments exclude pricing inputs and use a stable version. The comments keep the cache-key split understandable without changing build behaviour.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Stabilises crane Rust dependency caching by excluding pricing file path and release version from deps-only build args.

  • package.nix — Creates depsOnlyArgs that strips CCUSAGE_PRICING_JSON_PATH and pins version to 0.0.0 so Rust deps aren't rebuilt on pricing or version bumps. Exposes depsOnlyArgs via passthru for reuse.
  • nix/static-package.nix — Derives staticDepsOnlyArgs from the shared depsOnlyArgs cache key with static-target overlays, keeping dep caching consistent across build variants.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
nix/static-package.nix (1)

44-44: ⚡ Quick win

Clarify comment: "share" may mislead about cross-target caching.

The comment states "Share the same deps-only cache key" but adding --target ${linuxStaticTarget} in cargoExtraArgs creates a distinct cache artifact per target (e.g., x86_64-unknown-linux-musl vs aarch64-unknown-linux-musl vs native). The intended benefit is that within each target, the cache remains stable (unaffected by pricing JSON or version bumps), not that the main package and static package share one cache.

Consider rewording to clarify the stability goal rather than implying cross-target sharing:

-# Share the same deps-only cache key, then add static target settings.
+# Reuse the stable deps-only base (excludes pricing, pins version), then add static target settings.
🤖 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 `@nix/static-package.nix` at line 44, Update the inline comment that currently
reads "Share the same deps-only cache key" to make it clear that adding
`--target ${linuxStaticTarget}` in `cargoExtraArgs` creates a separate cache per
target, and that the intent is to keep the deps-only cache stable within each
specific target (so it isn't invalidated by unrelated changes like pricing JSON
or version bumps), not to imply a single shared cache across different targets;
reference the `cargoExtraArgs` and `${linuxStaticTarget}` symbols and rephrase
to state the stability-per-target goal.
🤖 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 `@nix/static-package.nix`:
- Line 44: Update the inline comment that currently reads "Share the same
deps-only cache key" to make it clear that adding `--target
${linuxStaticTarget}` in `cargoExtraArgs` creates a separate cache per target,
and that the intent is to keep the deps-only cache stable within each specific
target (so it isn't invalidated by unrelated changes like pricing JSON or
version bumps), not to imply a single shared cache across different targets;
reference the `cargoExtraArgs` and `${linuxStaticTarget}` symbols and rephrase
to state the stability-per-target goal.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ced9344a-9c41-4ced-9e89-871618a001ae

📥 Commits

Reviewing files that changed from the base of the PR and between 6d8c029 and 6cafadf.

📒 Files selected for processing (2)
  • nix/static-package.nix
  • package.nix
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.nix

@pkg-pr-new

pkg-pr-new Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

ccusage

npx https://pkg.pr.new/ccusage@1243

@ccusage/ccusage-darwin-arm64

npx https://pkg.pr.new/@ccusage/ccusage-darwin-arm64@1243

@ccusage/ccusage-darwin-x64

npx https://pkg.pr.new/@ccusage/ccusage-darwin-x64@1243

@ccusage/ccusage-linux-arm64

npx https://pkg.pr.new/@ccusage/ccusage-linux-arm64@1243

@ccusage/ccusage-linux-x64

npx https://pkg.pr.new/@ccusage/ccusage-linux-x64@1243

@ccusage/ccusage-win32-arm64

npx https://pkg.pr.new/@ccusage/ccusage-win32-arm64@1243

@ccusage/ccusage-win32-x64

npx https://pkg.pr.new/@ccusage/ccusage-win32-x64@1243

commit: 537f76b

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 6d8c0297ba8d
Base SHA: fb08569d82a5

This compares the Rust PR release binary against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new fb08569d82a5 1.096s 710.3ms 32.5ms 3
PR pkg.pr.new 6d8c029 798.6ms 837.8ms 31.8ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: fb08569d82a5; PR package: 6d8c029. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 561.0ms 556.6ms 1.01x 338.33 MiB 328.70 MiB 0.97x 1.79 GiB/s 1.81 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 379.2ms 375.7ms 1.01x 82.33 MiB 81.45 MiB 0.99x 2.66 GiB/s 2.68 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 565.8ms 1.78 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 540.7ms 1.86 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 382.3ms 2.63 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 340.4ms 2.96 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 30.1ms 4.3ms 6.92x 43.61 MiB 2.70 MiB 0.06x 0.05 MiB/s 0.36 MiB/s
claude session --offline --json 0.00 MiB 30.7ms 4.2ms 7.35x 43.61 MiB 2.83 MiB 0.06x 0.05 MiB/s 0.37 MiB/s
codex daily --offline --json 0.00 MiB 30.4ms 4.0ms 7.58x 43.48 MiB 2.70 MiB 0.06x 0.03 MiB/s 0.21 MiB/s
codex session --offline --json 0.00 MiB 30.3ms 3.8ms 7.92x 43.61 MiB 2.70 MiB 0.06x 0.03 MiB/s 0.22 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local 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 fixtures.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 560.4ms 537.6ms 1.04x 295.45 MiB 318.45 MiB 1.08x 1.80 GiB/s 1.87 GiB/s
codex --offline --json 1.01 GiB 370.3ms 341.9ms 1.08x 79.70 MiB 79.95 MiB 1.00x 2.72 GiB/s 2.94 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.30 KiB 17.30 KiB +0.00 KiB 1.00x
installed native package binary 3417.74 KiB 3417.74 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 6d8c0297ba8d
Base SHA: fb08569d82a5

This compares the PR package against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new fb08569d82a5 496.5ms 692.0ms 33.2ms 3
PR pkg.pr.new 6d8c029 819.6ms 560.3ms 33.1ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: fb08569d82a5; PR package: 6d8c029. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 576.0ms 563.8ms 1.02x 332.83 MiB 356.33 MiB 1.07x 1.75 GiB/s 1.79 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 370.5ms 375.0ms 0.99x 72.45 MiB 72.83 MiB 1.01x 2.72 GiB/s 2.68 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 573.3ms 1.76 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 544.1ms 1.85 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 397.6ms 2.53 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 343.3ms 2.93 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 30.5ms 29.8ms 1.02x 43.61 MiB 43.48 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
claude session --offline --json 0.00 MiB 31.8ms 30.6ms 1.04x 43.61 MiB 43.48 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
codex daily --offline --json 0.00 MiB 30.5ms 30.6ms 1.00x 43.48 MiB 43.61 MiB 1.00x 0.03 MiB/s 0.03 MiB/s
codex session --offline --json 0.00 MiB 31.0ms 30.7ms 1.01x 43.48 MiB 43.73 MiB 1.01x 0.03 MiB/s 0.03 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local 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 fixtures.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 584.2ms 559.0ms 1.04x 319.70 MiB 337.70 MiB 1.06x 1.72 GiB/s 1.80 GiB/s
codex --offline --json 1.01 GiB 376.0ms 375.3ms 1.00x 79.70 MiB 79.70 MiB 1.00x 2.68 GiB/s 2.68 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.30 KiB 17.30 KiB +0.00 KiB 1.00x
installed native package binary 3417.74 KiB 3417.74 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 6cafadf26c53
Base SHA: fb08569d82a5

This compares the Rust PR release binary against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new fb08569d82a5 683.7ms 757.0ms 30.4ms 3
PR pkg.pr.new 6cafadf 1.042s 797.9ms 31.2ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: fb08569d82a5; PR package: 6cafadf. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 574.8ms 548.9ms 1.05x 324.08 MiB 323.95 MiB 1.00x 1.75 GiB/s 1.83 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 366.8ms 364.5ms 1.01x 77.58 MiB 82.08 MiB 1.06x 2.74 GiB/s 2.76 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 531.5ms 1.89 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 583.4ms 1.73 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 362.7ms 2.78 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 347.6ms 2.90 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 28.0ms 3.8ms 7.39x - 2.70 MiB - 0.06 MiB/s 0.41 MiB/s
claude session --offline --json 0.00 MiB 28.7ms 3.9ms 7.29x 43.61 MiB 2.70 MiB 0.06x 0.05 MiB/s 0.39 MiB/s
codex daily --offline --json 0.00 MiB 28.2ms 3.7ms 7.69x 43.48 MiB 2.70 MiB 0.06x 0.03 MiB/s 0.23 MiB/s
codex session --offline --json 0.00 MiB 27.9ms 3.6ms 7.71x 43.48 MiB 2.70 MiB 0.06x 0.03 MiB/s 0.24 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local 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 fixtures.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 549.7ms 510.8ms 1.08x 320.95 MiB 326.20 MiB 1.02x 1.83 GiB/s 1.97 GiB/s
codex --offline --json 1.01 GiB 363.2ms 333.5ms 1.09x 72.70 MiB 68.45 MiB 0.94x 2.77 GiB/s 3.02 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.30 KiB 17.30 KiB -0.00 KiB 1.00x
installed native package binary 3417.74 KiB 3417.74 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 6cafadf26c53
Base SHA: fb08569d82a5

This compares the PR package against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new fb08569d82a5 1.022s 784.5ms 31.0ms 3
PR pkg.pr.new 6cafadf 868.4ms 911.3ms 30.1ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: fb08569d82a5; PR package: 6cafadf. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 570.4ms 546.7ms 1.04x 282.95 MiB 320.83 MiB 1.13x 1.77 GiB/s 1.84 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 369.3ms 363.0ms 1.02x 67.95 MiB 72.45 MiB 1.07x 2.73 GiB/s 2.77 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 546.2ms 1.84 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 528.6ms 1.90 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 363.6ms 2.77 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 340.3ms 2.96 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 28.3ms 29.0ms 0.97x 43.61 MiB 43.61 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
claude session --offline --json 0.00 MiB 28.5ms 28.3ms 1.01x 43.48 MiB 43.48 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
codex daily --offline --json 0.00 MiB 28.7ms 28.7ms 1.00x 43.61 MiB 43.48 MiB 1.00x 0.03 MiB/s 0.03 MiB/s
codex session --offline --json 0.00 MiB 28.5ms 28.9ms 0.99x 43.48 MiB 43.48 MiB 1.00x 0.03 MiB/s 0.03 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local 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 fixtures.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 554.8ms 535.9ms 1.04x 287.45 MiB 319.45 MiB 1.11x 1.81 GiB/s 1.88 GiB/s
codex --offline --json 1.01 GiB 361.2ms 359.0ms 1.01x 77.33 MiB 77.95 MiB 1.01x 2.79 GiB/s 2.80 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.30 KiB 17.30 KiB -0.00 KiB 1.00x
installed native package binary 3417.74 KiB 3417.74 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

Move development-only Nix modules into dev/flake.nix so root package builds no longer carry treefmt, git-hooks, and agent-skills inputs.

Switch setup-nix to nix-quick-install-action, split package and development cache scopes, and stop warming the dev shell by default.

Add just tasks for frozen pnpm installs and large fixture generation so CI workflows call shared recipes instead of repeating command lines.
nix-quick-install-action installs Nix in single-user mode, while the restored Nix store cache can contain root-owned paths. Chown the restored store on Linux before running nix build so Nix can create store locks.
The single-user Nix install also writes build logs under /nix/var/log/nix. Include that directory in the ownership fix after restoring the Nix store cache.
@pullfrog

pullfrog Bot commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

CI Fix: build-native-packages lock file permission denied

Diagnosis: Both Linux builds (arm64 and x64) failed on nix build .#ccusage-static with:

error: opening lock file '/nix/store/w0z2v28j0rdmwjdmdh4kznmwnlw3dn6g-source.lock': Permission denied

The Fix single-user Nix store ownership step (added in this PR) was chown-ing /nix/store to the CI user (sudo chown -R "$USER:$(id -gn)" /nix/store ...). nixbuild/nix-quick-install-action sets up /nix/store with permissions that Nix expects; overriding them broke lock file creation during flake evaluation.

Fix: Removed /nix/store from the chown loop in .github/actions/setup-nix/action.yaml. Only /nix/var/log/nix and /nix/var/nix are chowned — these are the directories that actually need ownership fixes after cache restore.

Commit: 82ce3dd on fix/nix-crane-deps-cache.

Task list (6/6 completed)
  • Checkout the PR branch (fix(nix): stabilise crane dependency cache #1243)
  • Fetch check suite logs to understand the failure
  • Verify failure was introduced by this PR
  • Diagnose and fix the CI failure
  • Apply fixes, commit, and push
  • Report progress with diagnosis and fix summary

Pullfrog  | View workflow run | via Pullfrog | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Moved development tooling into a separate dev/ flake to keep the main flake lean and split CI caching into package vs dev profiles.

  • dev/flake.nix + dev/flake.lock — New development flake that owns treefmt, git-hooks, agent-skills, and the dev shell, delegating package inputs to the main flake via follows.
  • flake.nix — Stripped dev-only inputs (agent-skills, git-hooks, treefmt-nix) and their imports, keeping only package/check logic with a touchup formatter disable.
  • .github/actions/setup-nix/action.yaml — Split into package and dev cache profiles, switched to nixbuild/nix-quick-install-action, made dev-shell warm-up conditional.
  • CI workflows — Updated all nix develop calls to nix develop ./dev#ci, added explicit just install steps, and set cache-profile: dev for development jobs.
  • nix/dev-shell.nix — Extracted package list into devShellPackages, added devShells.ci (same tools, no shellHook).
  • justfile — Added install and generate-large-fixture recipes, updated fmt/check/schema to target the dev flake.
  • Nix modules (agent-skills.nix, checks.nix, treefmt.nix) — Switched from inputs.self to hardcoded root = ./.. for nix-filter and treefmt project root, keeping them correct when imported from the dev flake.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Added a chown step to fix Nix store ownership after cache restoration with the quick installer.

  • .github/actions/setup-nix/action.yaml — Added Fix single-user Nix store ownership step that runs sudo chown -R "$USER:$(id -gn)" /nix/store /nix/var/log/nix /nix/var/nix on Linux, fixing permission errors from nixbuild/nix-quick-install-action restoring stores with wrong ownership.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

Use the Nix package build for the macOS arm64 native package in CI, matching the Linux Nix path while keeping Cargo builds for the remaining non-Nix platforms.

Make the single-user Nix ownership fix portable across non-Windows runners so macOS Nix cache restores can use the same setup action.
Use the Nix package build for both macOS native package targets in CI and release workflows, leaving Cargo builds only for Windows.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.github/workflows/release.yaml (1)

100-100: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add cache-profile: dev for consistency.

The npm job uses nix develop ./dev#ci commands (lines 115-116) but does not specify cache-profile: dev. Jobs executing via ./dev#ci should use the development cache scope to ensure consistent cache behavior and avoid misses.

⚡ Proposed fix
       - uses: ./.github/actions/setup-nix
+        with:
+          cache-profile: dev
🤖 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 @.github/workflows/release.yaml at line 100, The workflow step that currently
uses the local action "uses: ./.github/actions/setup-nix" should include the
cache scope so the Nix dev environment lines that run "nix develop ./dev#ci" use
the development cache; update that step to add the key "cache-profile: dev"
alongside the existing keys for the setup action so jobs invoking "nix develop
./dev#ci" benefit from the dev cache profile.
.github/workflows/ci.yaml (1)

184-184: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add cache-profile: dev for consistency.

The npm-publish-dry-run-and-upload-pkg-pr-now job uses nix develop ./dev#ci commands (lines 195, 197) but does not specify cache-profile: dev. All other jobs executing via ./dev#ci set cache-profile: dev to hit the development cache scope. This mismatch may cause cache misses and longer setup times.

⚡ Proposed fix
       - uses: ./.github/actions/setup-nix
+        with:
+          cache-profile: dev
🤖 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 @.github/workflows/ci.yaml at line 184, In the
npm-publish-dry-run-and-upload-pkg-pr-now job, update the setup step that uses
./.github/actions/setup-nix to include cache-profile: dev so it matches other
jobs using ./dev#ci; locate the step with the uses: ./.github/actions/setup-nix
reference in that job and add the cache-profile: dev input to ensure the Nix
setup uses the development cache scope.
🧹 Nitpick comments (3)
.github/actions/setup-nix/action.yaml (2)

20-44: ⚡ Quick win

Consider validating cache-profile input values.

The two cache steps are mutually exclusive and only handle 'package' or 'dev' values. If a caller passes an invalid value (e.g., typo like 'packge'), both steps silently skip and no caching occurs, which could degrade CI performance without obvious failure.

🛡️ Add a validation step
+    - name: Validate cache-profile input
+      if: inputs.cache-profile != 'package' && inputs.cache-profile != 'dev'
+      shell: bash
+      run: |
+        echo "::error::Invalid cache-profile '${{ inputs.cache-profile }}'. Must be 'package' or 'dev'."
+        exit 1
+
     - name: Cache Nix store for package builds
🤖 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 @.github/actions/setup-nix/action.yaml around lines 20 - 44, Add an explicit
validation step for the inputs.cache-profile value so typos don't silently
disable caching: create a new job step named like "Validate cache-profile input"
that runs early and checks inputs.cache-profile is either "package" or "dev" (or
set a default), and fail or warn with a clear error if it's invalid; update the
workflow to reference inputs.cache-profile in that check and keep the existing
steps "Cache Nix store for package builds" and "Cache Nix store for development
jobs" unchanged.

46-49: Confirm warm-dev-shell usage (step is currently unused in this repo)

warm-dev-shell is only defined in .github/actions/setup-nix/action.yaml and referenced in the step guard (if: inputs.warm-dev-shell == 'true'); there are no other workflow/action call sites in this repository that set warm-dev-shell (e.g., warm-dev-shell: true). As a result, the “Load Nix CI development environment” step never runs for current in-repo workflows.

If this action is intended to be used only within this repo, consider removing the warmup input/step; otherwise, document it as an optional behavior for external callers.

🤖 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 @.github/actions/setup-nix/action.yaml around lines 46 - 49, The action
defines an unused input warm-dev-shell and guards the "Load Nix CI development
environment" step with if: inputs.warm-dev-shell == 'true' so that step never
runs in-repo; either remove the warm-dev-shell input and delete the guarded step
("Load Nix CI development environment") to simplify the action, or keep the
input but add clear documentation and examples showing how external callers can
set warm-dev-shell: true (and update action metadata/README to document optional
behavior), ensuring the guarded run line and the inputs section (warm-dev-shell)
remain consistent with the chosen approach.
dev/flake.nix (1)

39-47: No package-attribute collision: ccusage input is only used for input pinning; dev packages come from ../nix/packages.nix.

dev/flake.nix imports ../nix/packages.nix, which defines the dev flake’s packages (including ccusage and models-dev-pricing). The ccusage flake input is not referenced by the dev modules (nix/dev-shell.nix, nix/treefmt.nix, nix/checks.nix, nix/agent-skills.nix, nix/git-hooks.nix)—they read config.packages.ccusage.* from the imported module—so there’s no attribute collision/override with inputs.ccusage.*. The overlap is only that both the root flake and the dev flake expose similarly named packages (ccusage), defined independently by the same nix/packages.nix module.

🤖 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 `@dev/flake.nix` around lines 39 - 47, The reviewer is worried about a
package-attribute collision between inputs.ccusage and the dev flake's packages;
fix this by either removing the unused top-level flake input (inputs.ccusage) if
it's only kept for pinning, or add an explicit comment inside dev/flake.nix next
to the imports array explaining that ../nix/packages.nix defines packages
(including ccusage and models-dev-pricing) and that dev modules
(nix/dev-shell.nix, nix/treefmt.nix, nix/checks.nix, nix/agent-skills.nix,
nix/git-hooks.nix) read config.packages.ccusage.* from that module so
inputs.ccusage is not used to provide dev packages; reference the imports list
and the ../nix/packages.nix module when making the change.
🤖 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 @.github/workflows/release.yaml:
- Around line 46-47: The build-native-packages job is incorrectly using the dev
cache profile; remove the "cache-profile: dev" setting (or change it to the
package/default cache scope) in the build-native-packages job so package builds
like the `nix build .#ccusage-static` step use the package cache rather than the
dev cache used by `./dev#ci` workflows; update the workflow so its cache
configuration matches the package-oriented job in ci.yaml.

In `@flake.nix`:
- Around line 34-40: The flake currently imports
inputs.flake-parts.flakeModules.touchup but only sets
touchup.attr.formatter.enable = false; either remove the touchup module import
or document why it must remain; to fix, search for
inputs.flake-parts.flakeModules.touchup and the touchup.attr.formatter.enable
assignment in flake.nix, and if no other touchup features are used remove the
module from the inputs and module list, otherwise add a concise comment above
touchup.attr.formatter.enable explaining why the module is required even though
only the formatter is disabled (e.g., to retain other default attributes or
compatibility).

---

Outside diff comments:
In @.github/workflows/ci.yaml:
- Line 184: In the npm-publish-dry-run-and-upload-pkg-pr-now job, update the
setup step that uses ./.github/actions/setup-nix to include cache-profile: dev
so it matches other jobs using ./dev#ci; locate the step with the uses:
./.github/actions/setup-nix reference in that job and add the cache-profile: dev
input to ensure the Nix setup uses the development cache scope.

In @.github/workflows/release.yaml:
- Line 100: The workflow step that currently uses the local action "uses:
./.github/actions/setup-nix" should include the cache scope so the Nix dev
environment lines that run "nix develop ./dev#ci" use the development cache;
update that step to add the key "cache-profile: dev" alongside the existing keys
for the setup action so jobs invoking "nix develop ./dev#ci" benefit from the
dev cache profile.

---

Nitpick comments:
In @.github/actions/setup-nix/action.yaml:
- Around line 20-44: Add an explicit validation step for the
inputs.cache-profile value so typos don't silently disable caching: create a new
job step named like "Validate cache-profile input" that runs early and checks
inputs.cache-profile is either "package" or "dev" (or set a default), and fail
or warn with a clear error if it's invalid; update the workflow to reference
inputs.cache-profile in that check and keep the existing steps "Cache Nix store
for package builds" and "Cache Nix store for development jobs" unchanged.
- Around line 46-49: The action defines an unused input warm-dev-shell and
guards the "Load Nix CI development environment" step with if:
inputs.warm-dev-shell == 'true' so that step never runs in-repo; either remove
the warm-dev-shell input and delete the guarded step ("Load Nix CI development
environment") to simplify the action, or keep the input but add clear
documentation and examples showing how external callers can set warm-dev-shell:
true (and update action metadata/README to document optional behavior), ensuring
the guarded run line and the inputs section (warm-dev-shell) remain consistent
with the chosen approach.

In `@dev/flake.nix`:
- Around line 39-47: The reviewer is worried about a package-attribute collision
between inputs.ccusage and the dev flake's packages; fix this by either removing
the unused top-level flake input (inputs.ccusage) if it's only kept for pinning,
or add an explicit comment inside dev/flake.nix next to the imports array
explaining that ../nix/packages.nix defines packages (including ccusage and
models-dev-pricing) and that dev modules (nix/dev-shell.nix, nix/treefmt.nix,
nix/checks.nix, nix/agent-skills.nix, nix/git-hooks.nix) read
config.packages.ccusage.* from that module so inputs.ccusage is not used to
provide dev packages; reference the imports list and the ../nix/packages.nix
module when making the change.
🪄 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: 4381962c-c5b7-4475-8396-6f5a1799d0e5

📥 Commits

Reviewing files that changed from the base of the PR and between 6cafadf and ea30778.

⛔ Files ignored due to path filters (2)
  • dev/flake.lock is excluded by !**/*.lock
  • flake.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • .envrc
  • .github/actions/setup-nix/action.yaml
  • .github/workflows/ci.yaml
  • .github/workflows/release.yaml
  • .github/workflows/update-pricing.yaml
  • dev/flake.nix
  • flake.nix
  • justfile
  • nix/agent-skills.nix
  • nix/checks.nix
  • nix/dev-shell.nix
  • nix/treefmt.nix

Comment thread .github/workflows/release.yaml Outdated
Comment thread flake.nix
Comment on lines +34 to +40
inputs.flake-parts.flakeModules.touchup
./nix/packages.nix
./nix/static-package.nix
./nix/checks.nix
./nix/dev-shell.nix
];

touchup.attr.formatter.enable = false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Search for touchup references in Nix modules

rg -n 'touchup' --type nix nix/

Repository: ryoppippi/ccusage

Length of output: 43


Clarify why touchup is imported only to disable its formatter
flake.nix imports inputs.flake-parts.flakeModules.touchup and then disables only touchup.attr.formatter.enable; if there’s no other touchup functionality relied on, consider removing the module import (or add a brief comment explaining why it must stay). Also, the nix/ directory contains no other touchup references.

🤖 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 `@flake.nix` around lines 34 - 40, The flake currently imports
inputs.flake-parts.flakeModules.touchup but only sets
touchup.attr.formatter.enable = false; either remove the touchup module import
or document why it must remain; to fix, search for
inputs.flake-parts.flakeModules.touchup and the touchup.attr.formatter.enable
assignment in flake.nix, and if no other touchup features are used remove the
module from the inputs and module list, otherwise add a concise comment above
touchup.attr.formatter.enable explaining why the module is required even though
only the formatter is disabled (e.g., to retain other default attributes or
compatibility).

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 32f3c6439412
Base SHA: fb08569d82a5

This compares the PR package against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new fb08569d82a5 693.6ms 850.8ms 33.3ms 3
PR pkg.pr.new 32f3c64 931.1ms 933.4ms 32.7ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: fb08569d82a5; PR package: 32f3c64. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 583.7ms 577.6ms 1.01x 336.70 MiB 330.08 MiB 0.98x 1.72 GiB/s 1.74 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 373.5ms 379.5ms 0.98x 81.83 MiB 77.45 MiB 0.95x 2.70 GiB/s 2.65 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 578.9ms 1.74 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 563.3ms 1.79 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 363.1ms 2.77 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 346.9ms 2.90 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 30.1ms 30.0ms 1.00x 43.48 MiB 43.48 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
claude session --offline --json 0.00 MiB 30.2ms 29.3ms 1.03x 43.36 MiB 43.23 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
codex daily --offline --json 0.00 MiB 29.4ms 29.1ms 1.01x 43.48 MiB 43.48 MiB 1.00x 0.03 MiB/s 0.03 MiB/s
codex session --offline --json 0.00 MiB 30.4ms 29.6ms 1.03x 43.61 MiB 43.61 MiB 1.00x 0.03 MiB/s 0.03 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local 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 fixtures.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 558.7ms 563.0ms 0.99x 326.45 MiB 296.45 MiB 0.91x 1.80 GiB/s 1.79 GiB/s
codex --offline --json 1.01 GiB 378.1ms 372.0ms 1.02x 72.45 MiB 79.70 MiB 1.10x 2.66 GiB/s 2.71 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.30 KiB 17.30 KiB -0.00 KiB 1.00x
installed native package binary 3417.74 KiB 3417.74 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 32f3c6439412
Base SHA: fb08569d82a5

This compares the Rust PR release binary against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new fb08569d82a5 700.1ms 533.5ms 30.8ms 3
PR pkg.pr.new 32f3c64 608.7ms 695.0ms 32.2ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: fb08569d82a5; PR package: 32f3c64. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 583.3ms 566.6ms 1.03x 320.20 MiB 345.08 MiB 1.08x 1.73 GiB/s 1.78 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 366.0ms 376.7ms 0.97x 70.58 MiB 80.33 MiB 1.14x 2.75 GiB/s 2.67 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 571.9ms 1.76 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 533.8ms 1.89 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 363.8ms 2.77 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 335.9ms 3.00 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 29.1ms 3.8ms 7.60x 43.48 MiB 2.70 MiB 0.06x 0.05 MiB/s 0.40 MiB/s
claude session --offline --json 0.00 MiB 29.9ms 3.9ms 7.65x 43.36 MiB 2.83 MiB 0.07x 0.05 MiB/s 0.40 MiB/s
codex daily --offline --json 0.00 MiB 28.9ms 3.6ms 7.93x 43.48 MiB 2.70 MiB 0.06x 0.03 MiB/s 0.23 MiB/s
codex session --offline --json 0.00 MiB 29.3ms 3.7ms 7.99x 43.48 MiB 2.70 MiB 0.06x 0.03 MiB/s 0.23 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local 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 fixtures.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 553.6ms 517.9ms 1.07x 324.33 MiB 325.45 MiB 1.00x 1.82 GiB/s 1.94 GiB/s
codex --offline --json 1.01 GiB 364.8ms 338.4ms 1.08x 81.33 MiB 72.33 MiB 0.89x 2.76 GiB/s 2.97 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.30 KiB 17.30 KiB -0.00 KiB 1.00x
installed native package binary 3417.74 KiB 3417.74 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Fixed a Nix store ownership issue, switched macOS native binary builds from Cargo to Nix for both arm64 and x64, and added a windows-11-arm matrix entry.

  • Fixed chown to skip /nix/store — Removes /nix/store from the ownership fix loop in setup-nix/action.yaml, leaving only /nix/var/log/nix and /nix/var/nix. Prevents Nix daemon lock permission errors from chowning store paths that must remain root-owned.

  • Switched macOS builds to Nix — Both ci.yaml and release.yaml now build Darwin binaries with nix build .#ccusage (binary path result/bin/ccusage) instead of cargo build. The Cargo path is now exclusive to Windows.

  • Simplified platform conditionals — Changed conditions from matrix.platform == 'linux' || (matrix.platform == 'darwin' && matrix.arch == 'arm64') / != 'linux' && !(darwin && arm64) to straightforward != 'win32' / == 'win32'. More readable and less error-prone.

  • Added windows-11-arm to build matrix — New native build entry uses Cargo (no Nix on Windows) with binary: rust/target/release/ccusage.exe.

  • Updated release.yaml npm and release jobs — Switched to nix develop ./dev#ci with just install for consistency, and added cache-profile: dev to the release job's Nix setup.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.github/workflows/ci.yaml (1)

187-187: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add cache-profile: dev to align cache scope with dev shell usage.

This job runs nix develop ./dev#ci commands (lines 198, 200), so it should use the dev cache profile. Using the default package cache pollutes the package cache with development dependencies and prevents cache rotation when dev tooling changes.

For consistency, all other jobs that execute ./dev#ci commands (lint-check, test, ccusage-perf-comment, ccusage-rust-perf-comment) already set cache-profile: dev.

🔧 Proposed fix
       - uses: ./.github/actions/setup-nix
+        with:
+          cache-profile: dev
       - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
🤖 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 @.github/workflows/ci.yaml at line 187, The setup-nix action invocation
(uses: ./.github/actions/setup-nix) is missing the cache-profile setting; update
that action call to include cache-profile: dev so the job uses the dev cache
profile (matching other jobs that run nix develop ./dev#ci) to avoid polluting
the package cache and ensure proper cache rotation.
.github/workflows/release.yaml (1)

101-101: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add cache-profile: dev to align cache scope with dev shell usage.

This job runs nix develop ./dev#ci commands (lines 116, 117), so it should use the dev cache profile. Using the default package cache pollutes the package cache with development dependencies and prevents cache rotation when dev tooling changes.

For consistency, the release job (line 131) already sets cache-profile: dev when executing ./dev#ci commands.

🔧 Proposed fix
       - uses: ./.github/actions/setup-nix
+        with:
+          cache-profile: dev
       - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
🤖 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 @.github/workflows/release.yaml at line 101, The step that invokes the custom
action "uses: ./.github/actions/setup-nix" must include "cache-profile: dev" so
the Nix cache scope matches the dev shell usage (the job runs "nix develop
./dev#ci"); update the step configuration for the setup-nix action to add
cache-profile: dev (matching the existing pattern used in the release job) to
avoid polluting the package cache with development dependencies.
🤖 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.

Outside diff comments:
In @.github/workflows/ci.yaml:
- Line 187: The setup-nix action invocation (uses: ./.github/actions/setup-nix)
is missing the cache-profile setting; update that action call to include
cache-profile: dev so the job uses the dev cache profile (matching other jobs
that run nix develop ./dev#ci) to avoid polluting the package cache and ensure
proper cache rotation.

In @.github/workflows/release.yaml:
- Line 101: The step that invokes the custom action "uses:
./.github/actions/setup-nix" must include "cache-profile: dev" so the Nix cache
scope matches the dev shell usage (the job runs "nix develop ./dev#ci"); update
the step configuration for the setup-nix action to add cache-profile: dev
(matching the existing pattern used in the release job) to avoid polluting the
package cache with development dependencies.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 56608743-a833-4748-ac15-d80b43221f69

📥 Commits

Reviewing files that changed from the base of the PR and between ea30778 and 537f76b.

📒 Files selected for processing (3)
  • .github/actions/setup-nix/action.yaml
  • .github/workflows/ci.yaml
  • .github/workflows/release.yaml

Add a just flake-check recipe that runs both the root package flake and the development tooling flake. Use it from lint-check so the workflow has one explicit check command while preserving the split flake responsibilities.

Make just typecheck depend on the frozen pnpm install so local and CI typechecks both install workspace dependencies first.
@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 480a2291d5d7
Base SHA: fb08569d82a5

This compares the Rust PR release binary against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new fb08569d82a5 1.265s 601.8ms 29.5ms 3
PR pkg.pr.new 480a229 943.8ms 742.0ms 29.7ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: fb08569d82a5; PR package: 480a229. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 558.0ms 558.4ms 1.00x 323.70 MiB 328.08 MiB 1.01x 1.80 GiB/s 1.80 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 375.0ms 373.6ms 1.00x 72.70 MiB 73.58 MiB 1.01x 2.68 GiB/s 2.69 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 561.9ms 1.79 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 521.4ms 1.93 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 368.9ms 2.73 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 339.4ms 2.97 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 28.1ms 3.9ms 7.21x 43.48 MiB 2.70 MiB 0.06x 0.06 MiB/s 0.40 MiB/s
claude session --offline --json 0.00 MiB 28.7ms 3.9ms 7.33x 43.48 MiB 2.70 MiB 0.06x 0.05 MiB/s 0.40 MiB/s
codex daily --offline --json 0.00 MiB 27.6ms 3.6ms 7.69x 43.73 MiB 2.70 MiB 0.06x 0.03 MiB/s 0.24 MiB/s
codex session --offline --json 0.00 MiB 27.1ms 3.5ms 7.69x - 2.70 MiB - 0.03 MiB/s 0.24 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local 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 fixtures.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 548.3ms 520.1ms 1.05x 330.08 MiB 296.70 MiB 0.90x 1.84 GiB/s 1.94 GiB/s
codex --offline --json 1.01 GiB 366.9ms 336.0ms 1.09x 67.33 MiB 72.45 MiB 1.08x 2.74 GiB/s 3.00 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.30 KiB 17.30 KiB +0.00 KiB 1.00x
installed native package binary 3417.74 KiB 3417.74 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 480a2291d5d7
Base SHA: fb08569d82a5

This compares the PR package against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new fb08569d82a5 647.5ms 576.8ms 31.5ms 3
PR pkg.pr.new 480a229 800.9ms 603.8ms 30.1ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: fb08569d82a5; PR package: 480a229. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 579.0ms 569.1ms 1.02x 303.20 MiB 325.95 MiB 1.08x 1.74 GiB/s 1.77 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 372.5ms 376.4ms 0.99x 70.20 MiB 83.45 MiB 1.19x 2.70 GiB/s 2.67 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 572.7ms 1.76 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 525.8ms 1.91 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 370.4ms 2.72 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 337.7ms 2.98 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 29.3ms 29.0ms 1.01x 43.23 MiB 43.48 MiB 1.01x 0.05 MiB/s 0.05 MiB/s
claude session --offline --json 0.00 MiB 29.6ms 29.1ms 1.02x 43.36 MiB 43.48 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
codex daily --offline --json 0.00 MiB 29.1ms 28.8ms 1.01x 43.48 MiB 43.48 MiB 1.00x 0.03 MiB/s 0.03 MiB/s
codex session --offline --json 0.00 MiB 28.3ms 28.2ms 1.00x 43.48 MiB 43.48 MiB 1.00x 0.03 MiB/s 0.03 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local 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 fixtures.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 554.0ms 560.4ms 0.99x 347.70 MiB 331.95 MiB 0.95x 1.82 GiB/s 1.80 GiB/s
codex --offline --json 1.01 GiB 377.6ms 373.7ms 1.01x 82.33 MiB 67.70 MiB 0.82x 2.67 GiB/s 2.69 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.30 KiB 17.30 KiB +0.00 KiB 1.00x
installed native package binary 3417.74 KiB 3417.74 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 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=".github/workflows/ci.yaml">

<violation number="1" location=".github/workflows/ci.yaml:33">
P3: Missing `--print-build-logs` on flake check commands. The original CI used this flag to surface build output during evaluation; without it, CI build failures are harder to debug.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread .github/workflows/ci.yaml
- run: nix develop --command just typecheck
with:
cache-profile: dev
- run: nix develop ./dev#ci --command just flake-check

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Missing --print-build-logs on flake check commands. The original CI used this flag to surface build output during evaluation; without it, CI build failures are harder to debug.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/ci.yaml, line 33:

<comment>Missing `--print-build-logs` on flake check commands. The original CI used this flag to surface build output during evaluation; without it, CI build failures are harder to debug.</comment>

<file context>
@@ -30,9 +30,7 @@ jobs:
-      - run: nix flake check --print-build-logs
-      - run: nix flake check ./dev --print-build-logs
-      - run: nix develop ./dev#ci --command just install
+      - run: nix develop ./dev#ci --command just flake-check
       - run: nix develop ./dev#ci --command just typecheck
 
</file context>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — Consolidated CI flake checks into a just flake-check recipe, added cache-profile: dev to the lint-check job, and made just typecheck auto-install frozen dependencies.

  • .github/workflows/ci.yaml lint-check job — Added cache-profile: dev to setup-nix so it matches other ./dev#ci jobs. Replaced the two flake-check steps with just flake-check and switched both remaining steps to the ./dev#ci dev shell.
  • justfile — typecheck now depends on install (pnpm install --frozen-lockfile) so typechecks always run against the correct workspace dependencies. Added flake-check recipe that runs both nix flake check (root) and nix flake check ./dev. check depends on typecheck flake-check.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: de8ab8029ed7
Base SHA: fb08569d82a5

This compares the PR package against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new fb08569d82a5 1.082s 1.038s 32.6ms 3
PR pkg.pr.new de8ab80 1.807s 1.078s 32.1ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: fb08569d82a5; PR package: de8ab80. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 555.4ms 575.7ms 0.96x 323.33 MiB 320.58 MiB 0.99x 1.81 GiB/s 1.75 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 367.2ms 371.3ms 0.99x 81.95 MiB 75.70 MiB 0.92x 2.74 GiB/s 2.71 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 559.1ms 1.80 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 536.2ms 1.88 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 373.0ms 2.70 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 338.2ms 2.98 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 29.5ms 28.1ms 1.05x 43.36 MiB 43.48 MiB 1.00x 0.05 MiB/s 0.06 MiB/s
claude session --offline --json 0.00 MiB 28.4ms 30.2ms 0.94x 43.48 MiB 43.61 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
codex daily --offline --json 0.00 MiB 27.9ms 28.3ms 0.99x 43.61 MiB 43.61 MiB 1.00x 0.03 MiB/s 0.03 MiB/s
codex session --offline --json 0.00 MiB 28.3ms 28.6ms 0.99x 43.48 MiB 43.61 MiB 1.00x 0.03 MiB/s 0.03 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local 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 fixtures.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 552.2ms 554.0ms 1.00x 318.58 MiB 317.83 MiB 1.00x 1.82 GiB/s 1.82 GiB/s
codex --offline --json 1.01 GiB 369.8ms 365.1ms 1.01x 72.33 MiB 82.08 MiB 1.13x 2.72 GiB/s 2.76 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.30 KiB 17.30 KiB +0.00 KiB 1.00x
installed native package binary 3417.74 KiB 3417.74 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: de8ab8029ed7
Base SHA: fb08569d82a5

This compares the Rust PR release binary against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new fb08569d82a5 1.025s 819.0ms 31.5ms 3
PR pkg.pr.new de8ab80 775.4ms 719.0ms 32.8ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: fb08569d82a5; PR package: de8ab80. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 577.4ms 573.4ms 1.01x 322.20 MiB 296.33 MiB 0.92x 1.74 GiB/s 1.76 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 373.4ms 370.2ms 1.01x 72.70 MiB 77.33 MiB 1.06x 2.70 GiB/s 2.72 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 572.5ms 1.76 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 538.7ms 1.87 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 368.7ms 2.73 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 341.3ms 2.95 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 29.3ms 4.0ms 7.34x 43.61 MiB 2.83 MiB 0.06x 0.05 MiB/s 0.39 MiB/s
claude session --offline --json 0.00 MiB 29.7ms 4.1ms 7.30x 43.36 MiB 2.70 MiB 0.06x 0.05 MiB/s 0.38 MiB/s
codex daily --offline --json 0.00 MiB 29.5ms 3.7ms 8.00x 43.48 MiB 2.70 MiB 0.06x 0.03 MiB/s 0.23 MiB/s
codex session --offline --json 0.00 MiB 29.4ms 4.0ms 7.41x 43.36 MiB 2.70 MiB 0.06x 0.03 MiB/s 0.22 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local 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 fixtures.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 558.6ms 537.8ms 1.04x 320.70 MiB 333.70 MiB 1.04x 1.80 GiB/s 1.87 GiB/s
codex --offline --json 1.01 GiB 358.1ms 333.0ms 1.08x 80.08 MiB 77.95 MiB 0.97x 2.81 GiB/s 3.02 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.30 KiB 17.30 KiB +0.00 KiB 1.00x
installed native package binary 3417.74 KiB 3417.74 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@ryoppippi
ryoppippi merged commit da74716 into main Jun 10, 2026
26 checks passed
@ryoppippi
ryoppippi deleted the fix/nix-crane-deps-cache branch June 10, 2026 11:33
@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 537f76bf3246
Base SHA: fb08569d82a5

This compares the Rust PR release binary against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new fb08569d82a5 1.072s 1.091s 33.1ms 3
PR pkg.pr.new 537f76b 1.170s 1.172s 31.1ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: fb08569d82a5; PR package: 537f76b. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 567.4ms 557.7ms 1.02x 320.33 MiB 341.58 MiB 1.07x 1.77 GiB/s 1.81 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 373.3ms 370.5ms 1.01x 80.08 MiB 77.45 MiB 0.97x 2.70 GiB/s 2.72 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 554.0ms 1.82 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 538.8ms 1.87 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 367.6ms 2.74 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 334.6ms 3.01 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 28.6ms 4.0ms 7.23x - 2.70 MiB - 0.05 MiB/s 0.39 MiB/s
claude session --offline --json 0.00 MiB 29.5ms 4.1ms 7.24x 43.36 MiB 2.70 MiB 0.06x 0.05 MiB/s 0.38 MiB/s
codex daily --offline --json 0.00 MiB 29.2ms 3.8ms 7.69x 43.48 MiB 2.70 MiB 0.06x 0.03 MiB/s 0.23 MiB/s
codex session --offline --json 0.00 MiB 28.8ms 3.7ms 7.78x 43.48 MiB 2.70 MiB 0.06x 0.03 MiB/s 0.23 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local 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 fixtures.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 557.1ms 535.9ms 1.04x 320.33 MiB 325.33 MiB 1.02x 1.81 GiB/s 1.88 GiB/s
codex --offline --json 1.01 GiB 369.2ms 338.7ms 1.09x 72.20 MiB 72.58 MiB 1.01x 2.73 GiB/s 2.97 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.30 KiB 17.30 KiB +0.00 KiB 1.00x
installed native package binary 3417.74 KiB 3417.74 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 537f76bf3246
Base SHA: fb08569d82a5

This compares the PR package against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new fb08569d82a5 1.115s 1.091s 32.8ms 3
PR pkg.pr.new 537f76b 1.379s 1.208s 31.3ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: fb08569d82a5; PR package: 537f76b. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 565.0ms 559.3ms 1.01x 336.20 MiB 310.58 MiB 0.92x 1.78 GiB/s 1.80 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 367.6ms 374.0ms 0.98x 77.70 MiB 80.08 MiB 1.03x 2.74 GiB/s 2.69 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 556.4ms 1.81 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 519.3ms 1.94 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 374.0ms 2.69 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 345.1ms 2.92 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 29.2ms 30.0ms 0.97x 43.36 MiB 43.61 MiB 1.01x 0.05 MiB/s 0.05 MiB/s
claude session --offline --json 0.00 MiB 29.5ms 29.6ms 1.00x 43.48 MiB 43.36 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
codex daily --offline --json 0.00 MiB 29.6ms 29.5ms 1.00x 43.48 MiB 43.36 MiB 1.00x 0.03 MiB/s 0.03 MiB/s
codex session --offline --json 0.00 MiB 29.5ms 29.2ms 1.01x 43.48 MiB 43.61 MiB 1.00x 0.03 MiB/s 0.03 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local 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 fixtures.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 560.1ms 557.1ms 1.01x 326.08 MiB 319.20 MiB 0.98x 1.80 GiB/s 1.81 GiB/s
codex --offline --json 1.01 GiB 373.6ms 368.4ms 1.01x 71.45 MiB 72.58 MiB 1.02x 2.69 GiB/s 2.73 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.30 KiB 17.30 KiB +0.00 KiB 1.00x
installed native package binary 3417.74 KiB 3417.74 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 615746418881
Base SHA: fb08569d82a5

This compares the Rust PR release binary against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new fb08569d82a5 875.8ms 831.9ms 30.3ms 3
PR pkg.pr.new 6157464 1.184s 1.073s 31.2ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: fb08569d82a5; PR package: 6157464. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 565.4ms 568.0ms 1.00x 317.70 MiB 316.70 MiB 1.00x 1.78 GiB/s 1.77 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 372.3ms 369.9ms 1.01x 79.20 MiB 72.20 MiB 0.91x 2.70 GiB/s 2.72 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 564.7ms 1.78 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 535.4ms 1.88 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 368.3ms 2.73 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 337.9ms 2.98 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 28.8ms 3.8ms 7.53x 43.48 MiB 2.70 MiB 0.06x 0.05 MiB/s 0.40 MiB/s
claude session --offline --json 0.00 MiB 28.4ms 3.9ms 7.24x 43.61 MiB 2.70 MiB 0.06x 0.05 MiB/s 0.39 MiB/s
codex daily --offline --json 0.00 MiB 27.7ms 3.6ms 7.68x 43.48 MiB 2.70 MiB 0.06x 0.03 MiB/s 0.24 MiB/s
codex session --offline --json 0.00 MiB 28.3ms 3.7ms 7.66x 43.61 MiB 2.70 MiB 0.06x 0.03 MiB/s 0.23 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local 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 fixtures.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs rust/target/release/ccusage directly. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 561.2ms 527.3ms 1.06x 318.70 MiB 318.33 MiB 1.00x 1.79 GiB/s 1.91 GiB/s
codex --offline --json 1.01 GiB 363.2ms 331.4ms 1.10x 82.20 MiB 78.83 MiB 0.96x 2.77 GiB/s 3.04 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.30 KiB 17.30 KiB -0.00 KiB 1.00x
installed native package binary 3417.74 KiB 3417.74 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 615746418881
Base SHA: fb08569d82a5

This compares the PR package against the configured base package on the same CI runner.

Package runner startup

Execution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one bunx -p <url> ccusage --version run with an empty Bun install cache. Warm reuses that cache and reports the median of repeated runs.

Package SHA Execution setup Bunx temp cache Bunx warm median Warm samples
Base pkg.pr.new fb08569d82a5 1.095s 1.000s 31.6ms 3
PR pkg.pr.new 6157464 1.105s 1.170s 31.6ms 3

Cached bunx execution performance

Runs the same large fixture through bunx -p <pkg.pr.new URL> ccusage after the Bun install cache has already been populated by the startup measurement. This separates cached package-runner execution from first-fetch package materialization.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base package: fb08569d82a5; PR package: 6157464. Both run through bunx -p <pkg.pr.new URL> ccusage using the warmed Bun install cache from package runner startup, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
bunx -p <pkg> ccusage claude --offline --json 1.01 GiB 576.8ms 575.6ms 1.00x 312.58 MiB 319.83 MiB 1.02x 1.75 GiB/s 1.75 GiB/s
bunx -p <pkg> ccusage codex --offline --json 1.01 GiB 376.1ms 370.0ms 1.02x 79.33 MiB 77.45 MiB 0.98x 2.68 GiB/s 2.72 GiB/s

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 575.0ms 1.75 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 544.1ms 1.85 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 383.1ms 2.63 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 336.8ms 2.99 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 29.2ms 29.4ms 0.99x 43.48 MiB 43.48 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
claude session --offline --json 0.00 MiB 29.8ms 29.5ms 1.01x 43.61 MiB 43.48 MiB 1.00x 0.05 MiB/s 0.05 MiB/s
codex daily --offline --json 0.00 MiB 29.8ms 29.4ms 1.01x 43.48 MiB 43.48 MiB 1.00x 0.03 MiB/s 0.03 MiB/s
codex session --offline --json 0.00 MiB 29.5ms 28.9ms 1.02x 43.48 MiB 43.48 MiB 1.00x 0.03 MiB/s 0.03 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local 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 fixtures.

Fixtures: Claude /home/runner/work/_temp/ccusage-large-fixture (1.01 GiB, 2,597 files), Codex /home/runner/work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2,597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 555.7ms 574.4ms 0.97x 326.33 MiB 337.45 MiB 1.03x 1.81 GiB/s 1.75 GiB/s
codex --offline --json 1.01 GiB 401.7ms 371.3ms 1.08x 72.33 MiB - - 2.51 GiB/s 2.71 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 17.30 KiB 17.30 KiB -0.00 KiB 1.00x
installed native package binary 3417.74 KiB 3417.74 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

ryoppippi added a commit that referenced this pull request Jun 10, 2026
* refactor(nix): merge development flake back into the root flake

Fold dev/flake.nix back into flake.nix so the repository ships a single
flake again: treefmt-nix, git-hooks, and agent-skills inputs return to
the root flake, and the development modules (treefmt, git-hooks,
dev-shell, agent-skills) are imported alongside the package modules.

The dev/ flake split (#1243) existed to keep package-only CI builds from
evaluating development inputs, trading a simpler setup for speed. With
the Blacksmith sticky-disk Nix store cache (#1249) the extra evaluation
cost no longer matters, so the simpler single-flake layout wins.

The pins for the restored inputs (agent-skills, git-hooks, treefmt-nix
and their transitive deps) are carried over verbatim from dev/flake.lock,
so no input revisions change. The dev shell is reached with plain
'nix develop' / 'use flake' again, and all './dev#' flake references
move back to the root flake.

* refactor(ci): drop the ci dev shell and explicit pnpm install steps

Remove devShells.ci and the just install / flake-check recipes that
existed to keep CI shells free of side effects. Every workflow now
enters the default dev shell with plain 'nix develop --command', whose
shellHook installs pnpm dependencies, syncs agent skills, and installs
git hooks.

The shellHook now runs 'pnpm install --frozen-lockfile' unconditionally
instead of comparing lockfile mtimes: an up-to-date install takes about
a second, and the conditional occasionally kept stale node_modules
around after branch switches.

Also drop the warm-dev-shell input from the setup-nix action (nothing
passed it any more) and restore the direct 'nix flake check
--print-build-logs' step in the lint job. The separate ci shell and
explicit install steps were a #1243-era optimisation to avoid paying
the shellHook cost in CI; with sticky-disk caching the cost is noise
and the extra indirection just made the setup harder to follow.

* ci: report what the Nix and node_modules caches restored

The sticky disk and cache-nix-action steps only log that a mount or
restore happened, so job logs never showed whether the run started warm
or cold, or what the restored data actually was.

Add report steps after each restore that print the sticky disk key, the
mount path, disk usage, and the number of restored Nix store paths or
top-level node_modules entries, with an explicit cold-start message when
the disk or cache comes back empty.

* Revert "ci: report what the Nix and node_modules caches restored"

This reverts commit af47cba.

* Update nix/dev-shell.nix

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* chore(ci): update github actions

* ci: simplify pnpm version resolution for the sticky disk key

Read the packageManager pin with jq instead of a node -p invocation and
a case statement. The resolved version only feeds the node_modules
sticky disk cache key; the pnpm that actually runs self-resolves to the
pinned version via manage-package-manager-versions regardless of which
binary starts it.

* ci: stop caching node_modules on a sticky disk

Drop the root node_modules sticky disk and the pnpm version resolution
that only existed to build its cache key. A warm disk saved roughly
twenty seconds of pnpm install, while mounting cost five to forty-five
seconds per job (and occasionally failed outright), every job committed
a snapshot even when nothing ran pnpm, and the per-GB-billed disk grew
to tens of gigabytes despite node_modules holding about 500 MB of
files. Installing from the registry on each run is cheaper and simpler.

The Nix store sticky disk stays; that one caches multi-gigabyte build
closures that are genuinely expensive to recreate.

---------

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant