playbook omits the drill-down tools its own conclusions need #2
Notifications
Total Time Spent: 25 minutes
oleks
25 minutes
No due date set.
Dependencies
No dependencies set.
Reference: oleks/analytics-playbook#2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
playbook.xsh's docstring says it collects "every token-usage and plugin-workflow report in one run". It does not. Present in the audit plugins, never invoked:cc-tokens context --session <id>pa firings [--slowest] [--errors-only] [--slower-than MS]pa hooks' aggregatespa inventory,pa tags --allinstrument report --all-profiles --group-by plugin,event,hookhook-instrumentplugin is absent from the runinstrument report --failures / --bursts / --gapsinstrument check-wiring -root <plugin>boundary-classify,stability-classify,filing-plancandidate-digestWhy it matters
The two gaps that cost the most:
cc-tokens context. The run establishes that 97.7% of all tokens are context re-read at 246.8k mean per turn, andhogsnames the culprit sessions (b7b84b10, 1,498 turns, peak 999.6k). It never asks what pushed those contexts up.contextis the only tool that answers that, and it is the answer any deterministic gate would key on.candidate-digestis the last IA step run.boundary-classifyandstability-classifyexist precisely so the rubric and the evidence-stability gate are applied mechanically. Stopping at the digest hands a model the job two scripts already do.hook-instrumentis not inDEFAULT_PLUGINSat all, so hook cost — the economics of the thing the playbook exists to inform — is unmeasured.Acceptance
Add the steps, or narrow the docstring's claim. Suggested shape: a
contextstep for the top N sessions fromhogs, ahigroup wrappinginstrument report/check-wiring, and the two IA classifiers chained aftercandidate-digest.Sequencing note — the tier below this one
Everything in this issue is runnable today:
cc-tokens context,pa firings/inventory/tags, all ofhook-instrument, and IA'sboundary-classify/stability-classify/filing-planall exist and work. Nothing here waits on anything.Worth recording alongside it, though, that closing this issue still will not answer the question the playbook exists to serve — which tool calls to gate on. That measurement does not exist anywhere in the fleet and is tracked separately:
priority/high).The relationship, so a later reader does not have to reconstruct it:
cc-tokens+pa utilization/cost/heatmapDeliberately not adding a
blockedlabel: this issue is not blocked by #16, and marking it so would stall six actionable steps behind one that has not started.If #16 lands, this issue gains one more step (collect the payload ranking per hog session). If it never lands, everything listed here is still worth doing.
Plan (posted before the first code edit) — and two corrections to the table above
Worked as one pass with oleks/analytics-playbook#1 and oleks/analytics-playbook#3 — same file.
I re-derived every named tool's real surface from its own
--help/source rather than from the table, because a sibling issue in this same batch (kotkan/claude-plugin-plugin-analytics#14) asserted seven affected subcommands where there were eight — the evidence came from a playbook run, and the playbook never called the eighth. That check paid off twice here.Correction 1 — the table is SHORT:
cc-tokens payloadsexists and is missing from itcc-tokens --helplists eight subcommands, not the seven the playbook knows about pluscontext:This matters more than a missing row, because it falsifies the tier table in this issue's own sequencing comment. That comment says tier 3 — "which tool result caused the growth" — is a measurement that "does not exist anywhere in the fleet", tracked as kotkan/claude-plugin-token-budget#16. It exists now. Verified running:
I am adding it to the run. I am not touching
token-budget(a peer holds kotkan/claude-plugin-token-budget#16); whether that issue should now close is the peer's and the shepherd's call, not mine — flagging it, not acting on it.Correction 2 — the table is WRONG about the IA classifiers: they cannot be chained here
The issue proposes "the two IA classifiers chained after
candidate-digest" and calls them "the deterministic half of the offload decision". They are deterministic, but their input is not. Frominference-arbitrage/bin/boundary-classify's own docstring:Its CLI confirms it:
boundary-classify [judgments]takes a candidate judgments JSON, notcandidate-digestoutput.stability-classify --classifiedthen consumesboundary-classify's output, andfiling-plansits downstream of that. So the whole three-tool chain is gated behind a model pass.The playbook is "Deliberately collection-only: no claude -p". Chaining these would either break that property or feed the classifiers fabricated judgments and produce confident grades from nothing. Neither is acceptable, so I am not adding them — and the docstring will say so explicitly rather than leave the gap unexplained.
What I am adding (all verified working before promising)
cc-tokens payloadsper profilecc-tokenssteps already runcc-tokens context --session <id>for the top N hog sessionspa inventory,pa tags --all,pa firings --slowest--json, same cost class as the sevenpasteps already runhigroup:instrument report --all-profiles --group-by plugin,event,hook,--failures,--bursts,--gaps;instrument check-wiringper pluginWhat I am NOT adding, and why (this is the narrowing half)
hook-instrumentintoDEFAULT_PLUGINS— this is explicitly an operator decision, since it changes what every group iterates. It also turns out to be unnecessary for the measurement:instrument report --all-profilesreads the state log directly and needs no entry in the plugin list. Recommendation: add it separately, on its own merits, not as a side effect of this issue. Thehigroup works either way.Per the issue's acceptance ("add the steps, or narrow the claim"), I am doing both halves honestly: adding what is genuinely collectible, and narrowing the docstring to name what it deliberately excludes and why. A quietly shortened claim would be the same defect pointing the other way.
Incidental observation
instrument report --all-profilesreads a third profile this repo's tooling does not otherwise mention:/home/oleks/.claude-old(157 records, against 199,927 and 188,121 for the two live ones). Recording it because a coverage claim that says "both profiles" while a tool reads three is exactly the class of thing oleks/analytics-playbook#3 is about. Not acting on it.Wall-clock cost of everything added will be measured against the baseline run and reported here before this closes.
Done —
938e09d+04cf5f4, landed onmainBoth halves of the acceptance: added what is genuinely collectible, and narrowed the docstring to name what it excludes and why.
Added (25 new steps per run, all verified in a real run)
cc-tokens payloads× 2 profilescc-tokens context --session× top-3 hogs × 2 profilespa inventorypa tags --allpa firings --slowesthigroup:instrument report/--failures/--bursts/--gapsinstrument check-wiringper hook-declaring pluginNOT added, stated in the docstring rather than quietly dropped
boundary-classify,stability-classify,filing-plan— for the reason in the plan comment: their input is model-produced judgments, so chaining them in a collection-only run would grade fabricated input. The docstring now carries aWHAT THIS RUN DELIBERATELY DOES NOT COLLECTsection naming them and giving that reason, and the summary header repeats it. The issue's suggested shape was wrong on this point and the correction is the substantive finding here — see the plan comment for the tool's own docstring.hook-instrumentis not inDEFAULT_PLUGINS. It turned out not to need to be:instrument report --all-profilesreads the state log directly. Recommendation to the operator: add it on its own merits, not as a side effect of this issue — it changes what every group iterates.The one round-trip the additions caught immediately
check-wiringexits 64 on a plugin with nohooks/hooks.json, which is neither a pass nor a wiring failure. Six of the ten default plugins declare no hooks, so the first cut logged six failed steps and the summary read "6 did not exit 0" for a non-finding. Fixed in04cf5f4: those plugins are skipped explicitly and reported as such, keeping declares no hooks distinct from checked and passed —Wall-clock cost — the number the operator needs
Two full runs, emmett,
--days 30, two profiles, ten plugins:Attributed, because the two issues should not be billed to each other:
contextcurves 100.9s (6 sessions),payloads48.8s,higroup 8.4s, newpasubcommands 5.9s.--root: +192.3s (theiagroup goes 176.8s → 369.1s — twice the transcript volume).So the honest headline is ~7min → ~13min, and the larger half of that is #3, not this issue. If the run's length becomes a problem, the cheapest lever is
--hogs-context(default 3; each curve costs 11–39s), then--days. Nothing added here is in the hot path of the other groups.No step exceeded 60s in either run — the slowest was 39.4s (
contexton a 464-turn session).The correction worth carrying forward
cc-tokens payloadsexists and is now collected. That falsifies this issue's own sequencing comment, which lists tier 3 — "which tool result caused the growth" — as a measurement that "does not exist anywhere in the fleet", tracked at kotkan/claude-plugin-token-budget#16. It exists and works; the run reportsexplained_pct: 11.2against measuredcache_readfor~/.claudeover 2 days. I have not touchedtoken-budgetand take no view on whether #16 should close — that is its holder's and the shepherd's call, but somebody should look.Limits
Two runs, one host, one point in time.
--jsonwas verified per tool before adding, but I did not audit every added subcommand's output schema for downstream consumers — the steps are collected, not yet digested by anything.⏱ worked | 06-09-26 | session oleks/2fede70c | +25min | session-total 25min (landed at
04cf5f4on origin/main; issue closed with evidence) | elapsed from timeline