--- license: apache-2.0 pretty_name: CC Traces — Weka, With Subagents, v5 only (May 18 2026) task_categories: - text-generation tags: - llm - inference - benchmarking - kv-cache - agentic - multi-turn - claude - subagents size_categories: - n<1K configs: - config_name: default data_files: - split: train path: traces.jsonl --- # CC Traces — Weka, With Subagents, v5 only (May 18 2026) A collection of **98 multi-turn agentic traces** drawn from real production traffic against Claude Code CLI ≥ 2.1.139. Each trace captures the full request/response sequence of a single agent session, including per-request KV block hashes AND the original sub-agent fan-out structure (Task-tool spawned sub-agents grouped into `WekaSubagentEntry` blocks). **With-subagents, v5-only, CC ≥ 2.1.139 variant.** Companion to [cc-traces-weka-no-subagents-051826](https://huggingface.co/datasets/semianalysisai/cc-traces-weka-no-subagents-051826), which is the same 98 traces with all `WekaSubagentEntry` blocks stripped. Three filters: 1. **v5 only.** Every replayable request in every included session has `trace_version = 5` (latest proxy schema, o200k_base tokenizer). 2. **Claude Code CLI ≥ 2.1.139.** Every successful request in every included session is on a CC build that ships the `x-claude-code-agent-id` HTTP header — the canonical signal sub-agent grouping depends on. Sessions without it would have unreliable grouping (legacy stretch-based fallback can mis-group concurrent same-label sub-agents) and are excluded entirely. 3. **≥ 20 main-agent turns** post-strip. Sub-agent fan-out is on top of that. - **Traces:** 98 - **Top-level entries:** 23,443 (22,822 main turns + 621 subagent groups) - **Sub-agent inner requests:** 16,332 - **Total individual model requests:** 39,154 - **Models:** `claude-opus-4-7`, `claude-haiku-4-5-20251001`, `claude-opus-4-6`, `claude-sonnet-4-6` - **KV block size:** 64 tokens - **Hash scope:** `local` ## Sub-agent grouping Identical algorithm to the proxy dashboard's [`buildRequestRuns`](https://github.com/SemiAnalysisAI/semianalysis-claude-code-proxy/blob/main/packages/app/src/lib/subagent-runs.ts). Two passes over chronologically-sorted DB rows: 1. **Pre-collect header-keyed groups:** for every row with `x-claude-code-agent-id`, gather ALL rows with the same id into one group across the entire session (not just contiguous stretches). Background sub-agents that overlap with main-agent turns collapse correctly. 2. **Emit chronologically:** - `subagent_label IS NULL` → main turn at position - has agent-id, first sighting → emit the pre-collected group - has agent-id, already emitted → skip - has label but no agent-id → fallback contiguous-stretch grouping For CC ≥ 2.1.139 all groups go through the header-keyed path; the fallback isn't exercised. That's why we require CC ≥ 2.1.139 — the fallback can mis-group concurrent same-label sub-agents. ## Tokenizer caveat `in` and `hash_ids` are in proxy tokenizer (`o200k_base`). Anthropic reports ~60 % of the o200k count for the same content. ISL numbers are bigger than what Anthropic would bill, but self-consistent between `in` and `hash_ids` for cache-hit simulation. ## What's in each trace Top-level: `id`, `models`, `block_size: 64`, `hash_id_scope: "local"`, `requests: list`. ### Main-agent request (`type: "n"` or `"s"`) | field | type | description | |---|---|---| | `t` | float | seconds since trace start | | `type` | str | `n` (non-streaming) or `s` (streaming) | | `model` | str | target model | | `in` | int | input tokens (proxy tokenizer) | | `out` | int | output tokens | | `hash_ids` | list[int] | per-trace local block IDs | | `api_time` | float | end-to-end server seconds | | `think_time` | float? | gap from previous request's end | | `ttft` | float? | streaming only | ### Sub-agent group (`type: "subagent"`) | field | type | description | |---|---|---| | `t` | float | start of the group | | `type` | str | `"subagent"` | | `agent_id` | str | stable id (slug + 8-char suffix from `x-claude-code-agent-id`) | | `subagent_type` | str | `"Subagent"` for CC ≥ 2.1.139 | | `duration_ms` | int | first→last inner wall-clock | | `total_tokens` | int | Σ(in+out) across inners | | `tool_use_count` | null | not tracked | | `status` | str | `"completed"` | | `requests` | list | inner Shape-A entries (all `type: "n"`) | | `models` | list[str] | distinct models inside | Inner requests carry **absolute `t` values**, so flattening + chronological re-sort works directly: `sorted(main + flatten(inner), key=lambda x: x['t'])`. ## Summary statistics Across **all** requests (main + sub-agent inner = 39,154): | | p50 | p75 | p90 | p95 | p99 | mean | |------------------------------|---------:|---------:|---------:|---------:|---------:|---------:| | ISL (tokens) | 103,026 | 231,708 | 440,033 | 573,767 | 799,819 | 173,073 | | OSL (tokens) | 223 | 476 | 1,152 | 1,907 | 5,413 | 527 | | Top entries/trace | 126 | 304 | 571 | 733 | 1,120 | 239 | ## Plots ### Main-agent stream Histograms across all 22,822 main-agent turns (sub-agent groups skipped). Identical to the [no-subagents sibling](https://huggingface.co/datasets/semianalysisai/cc-traces-weka-no-subagents-051826). ![Main-stream distributions — log x](plots/distributions_log.png) ![Main-stream distributions — linear x](plots/distributions_linear.png) ### Sub-agent fan-out analysis Histograms across all 621 sub-agent groups and their 16,332 inner requests. ![Sub-agent distributions — log x](plots/subagent_distributions_log.png) ![Sub-agent distributions — linear x](plots/subagent_distributions_linear.png) Six panels: groups per trace · inner requests per group · group wall-clock duration · group total tokens · inner-request ISL · intra-group cache hit rate. ## Model composition | model | requests (main + subagent inner) | |-------|---------:| | `claude-opus-4-7` | 38,058 | | `claude-haiku-4-5-20251001` | 702 | | `claude-opus-4-6` | 343 | | `claude-sonnet-4-6` | 51 | ## Source Same proxy → weka pipeline as the [no-subagents sibling](https://huggingface.co/datasets/semianalysisai/cc-traces-weka-no-subagents-051826), without the post-step that strips `WekaSubagentEntry` blocks. 1. `utils/sample_proxy_traces.py --min-trace-version 5 --min-main-turns 20 --require-cli-min 2.1.139 --privacy-mode anon` 2. `utils/proxy_to_weka.py` (subagent grouping per [proxy `lib/subagent-runs.ts`](https://github.com/SemiAnalysisAI/semianalysis-claude-code-proxy/blob/main/packages/app/src/lib/subagent-runs.ts)) 3. Concatenate the resulting weka JSONs into `traces.jsonl` — one trace per line. The same-98-trace contract with the no-subagents sibling makes the two variants safe to A/B compare for any benchmark that cares about sub-agent fan-out's impact on cache-hit-rate or throughput.