feat: cctrace insights — windowed usage aggregates + the cctrace-insights skill - #107
Merged
Conversation
lroolle
force-pushed
the
feat/insights
branch
2 times, most recently
from
September 2, 2026 04:26
fc51e90 to
9a4efb2
Compare
…ghts skill The data layer for 'how is caching going this week / where did the money and quota go / which session is heavy': foldRuns over the registry's exit stats (instant), createScanFold streaming the window's traces for the wire truth — cache split with est $ per component, per-model, per-session, quota polls. The cctrace-insights skill reads --json and writes the report; cctrace never reasons (title precedent). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
lroolle
force-pushed
the
feat/insights
branch
from
September 2, 2026 04:26
9a4efb2 to
bffb16b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Item 2 of Eric's 2026-08-31 batch: "skillize our cctrace abilities for tracing insights — how's the prompt caching going in the last 7d, where our quota costs went, which session is doing the heaviest work, suggestions for maximizing our subscriptions."
Same division of labor as
cctrace title(0.43): cctrace computes, the skill reasons.The data layer —
cctrace insights--scanstreams every in-window trace for what only the wire knows: the cache read/write/uncached split with estimated dollars per component, per-model and per-session weight, and every account-quota poll (5h / 7d / model-scoped windows). Measured: 3.3 GB of 24h traces folded in 4.8 s — cache hit 98%, ≈$140 of ≈$215 was cache reads, quota 7d at 74%.src/insights.ts(parseWindow / runInWindow / foldRuns / createScanFold), unit-tested on synthetic pairs (7 tests: flat exit-stat fields, window edges, cache-hit share, dedupe, quota min/max/last, the never-cached null).The skill —
skills/cctrace-insightsTriggers on the usage questions, runs
insights --json, and writes the report under cctrace's own honesty rules (≈ on every dollar, coverage gaps stated, runs and scan never added together) with evidence-gated recommendations — low cache hit % → look for many short runs instead of continued sessions; a 7d window peaking while 5h idles → batch after the reset; one session dominating → open its Context view's "where the money went".Verification
bun test893/0 (7 new). Real-store smoke: fast path and--since 24h --scanoutputs in the PR-linked session above.🤖 Generated with Claude Code