Datasets:
filter to CC >=2.1.139 (header-keyed grouping); +2 traces (98 total)
Browse files- README.md +88 -106
- plots/distributions_linear.png +2 -2
- plots/distributions_log.png +2 -2
- plots/subagent_distributions_linear.png +2 -2
- plots/subagent_distributions_log.png +2 -2
- traces.jsonl +2 -2
README.md
CHANGED
|
@@ -23,166 +23,148 @@ configs:
|
|
| 23 |
|
| 24 |
# CC Traces — Weka, With Subagents, v5 only (May 18 2026)
|
| 25 |
|
| 26 |
-
A collection of **
|
| 27 |
-
traffic against
|
| 28 |
request/response sequence of a single agent session, including per-request
|
| 29 |
KV block hashes AND the original sub-agent fan-out structure (Task-tool
|
| 30 |
spawned sub-agents grouped into `WekaSubagentEntry` blocks).
|
| 31 |
|
| 32 |
-
**With-subagents, v5-only variant.** Companion to
|
| 33 |
[cc-traces-weka-no-subagents-051826](https://huggingface.co/datasets/semianalysisai/cc-traces-weka-no-subagents-051826),
|
| 34 |
-
which is the same
|
| 35 |
|
| 36 |
-
|
| 37 |
-
- Simulate the full agentic-coding workload including parallel Task-tool
|
| 38 |
-
sub-agent fan-out
|
| 39 |
-
- Study sub-agent dispatch patterns, instance counts, durations
|
| 40 |
-
- Replay against an inference engine that should see the same concurrent-
|
| 41 |
-
request structure a real Claude Code session generates
|
| 42 |
-
|
| 43 |
-
Use the **no-subagents sibling** when you want a single linear main-agent
|
| 44 |
-
stream per trace and don't care about the parent / child fan-out.
|
| 45 |
-
|
| 46 |
-
Same filters as the sibling:
|
| 47 |
|
| 48 |
1. **v5 only.** Every replayable request in every included session has
|
| 49 |
-
`trace_version = 5` (
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
- **
|
|
|
|
|
|
|
|
|
|
| 59 |
- **Models:** `claude-opus-4-7`, `claude-haiku-4-5-20251001`, `claude-opus-4-6`, `claude-sonnet-4-6`
|
| 60 |
- **KV block size:** 64 tokens
|
| 61 |
-
- **Hash scope:** `local`
|
| 62 |
-
a single trace; they are not a global content-addressable identity.
|
| 63 |
|
| 64 |
-
##
|
| 65 |
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
content. So the ISL numbers below are larger than what the Anthropic
|
| 70 |
-
API would have billed for the same prompt — but they're self-consistent
|
| 71 |
-
between `in` and `hash_ids`, which is what matters for KV-cache replay
|
| 72 |
-
simulation.
|
| 73 |
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
-
|
|
|
|
|
|
|
| 77 |
|
| 78 |
-
|
| 79 |
-
|-----------------|------------------|-----------------------------------------------------|
|
| 80 |
-
| `id` | str | Trace identifier (the proxy session id) |
|
| 81 |
-
| `models` | list[str] | Models used by the trace |
|
| 82 |
-
| `block_size` | int | KV block size used to derive `hash_ids` (64) |
|
| 83 |
-
| `hash_id_scope` | str | `local` — hash IDs are per-trace, not global |
|
| 84 |
-
| `requests` | list[object] | Ordered list of per-request records OR `WekaSubagentEntry` groups |
|
| 85 |
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
### Main-agent request (`type: "n"` or `"s"`)
|
| 89 |
|
| 90 |
-
| field
|
| 91 |
-
|---
|
| 92 |
-
| `t`
|
| 93 |
-
| `type`
|
| 94 |
-
| `model`
|
| 95 |
-
| `in`
|
| 96 |
-
| `out`
|
| 97 |
-
| `hash_ids`
|
| 98 |
-
| `api_time`
|
| 99 |
-
| `think_time`
|
| 100 |
-
| `ttft`
|
| 101 |
|
| 102 |
### Sub-agent group (`type: "subagent"`)
|
| 103 |
|
| 104 |
-
| field
|
| 105 |
-
|---
|
| 106 |
-
| `t`
|
| 107 |
-
| `type`
|
| 108 |
-
| `agent_id`
|
| 109 |
-
| `subagent_type` | str
|
| 110 |
-
| `duration_ms`
|
| 111 |
-
| `total_tokens`
|
| 112 |
-
| `tool_use_count`| null
|
| 113 |
-
| `status`
|
| 114 |
-
| `requests`
|
| 115 |
-
| `models`
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
values (not relative to the group start), making sub-agent and main-
|
| 120 |
-
agent timelines directly interleavable for replay.
|
| 121 |
-
|
| 122 |
-
`hash_ids` make the dataset unusually useful for KV-cache work: the
|
| 123 |
-
contiguous common prefix between turn *t* and turn *t − 1* exactly
|
| 124 |
-
measures the portion of the input that a local prefix cache would be
|
| 125 |
-
able to reuse. The same accounting applies to sub-agent inner requests
|
| 126 |
-
within their group, and to the dispatching parent request that
|
| 127 |
-
triggered them.
|
| 128 |
|
| 129 |
## Summary statistics
|
| 130 |
|
| 131 |
-
Across **all** requests (main + sub-agent inner =
|
| 132 |
|
| 133 |
| | p50 | p75 | p90 | p95 | p99 | mean |
|
| 134 |
|------------------------------|---------:|---------:|---------:|---------:|---------:|---------:|
|
| 135 |
-
| ISL (tokens) |
|
| 136 |
-
| OSL (tokens) |
|
| 137 |
-
| Top entries/trace |
|
| 138 |
|
| 139 |
## Plots
|
| 140 |
|
| 141 |
### Main-agent stream
|
| 142 |
|
| 143 |
-
Histograms across all
|
| 144 |
-
Same view as the [no-subagents sibling](https://huggingface.co/datasets/semianalysisai/cc-traces-weka-no-subagents-051826) — the two datasets share an identical main-agent stream.
|
| 145 |
|
| 146 |

|
| 147 |

|
| 148 |
|
| 149 |
### Sub-agent fan-out analysis
|
| 150 |
|
| 151 |
-
Histograms across all
|
| 152 |
|
| 153 |

|
| 154 |

|
| 155 |
|
| 156 |
-
Six panels:
|
| 157 |
-
|
| 158 |
-
1. **Sub-agent groups per trace** — distribution of how many distinct sub-agent invocations each session spawns
|
| 159 |
-
2. **Inner requests per group** — depth of each sub-agent's tool-use loop
|
| 160 |
-
3. **Group wall-clock duration** — first→last inner span (seconds)
|
| 161 |
-
4. **Group total tokens** — `Σ(in + out)` across each group's inner requests
|
| 162 |
-
5. **Inner-request ISL** — per-call input length INSIDE sub-agent loops (smaller than main-agent turns because sub-agents work on focused sub-problems with trimmed context)
|
| 163 |
-
6. **Intra-group cache hit rate** — for each non-first inner request, fraction of `hash_ids` already seen in earlier inners of the SAME group. Captures how much KV-cache reuse a local prefix cache would get out of a sub-agent's tool-use loop (typically high — sub-agents iterate on a stable prompt)
|
| 164 |
|
| 165 |
## Model composition
|
| 166 |
|
| 167 |
| model | requests (main + subagent inner) |
|
| 168 |
|-------|---------:|
|
| 169 |
-
| `claude-opus-4-7` |
|
| 170 |
| `claude-haiku-4-5-20251001` | 702 |
|
| 171 |
| `claude-opus-4-6` | 343 |
|
| 172 |
-
| `claude-sonnet-4-6` |
|
| 173 |
|
| 174 |
## Source
|
| 175 |
|
| 176 |
Same proxy → weka pipeline as the
|
| 177 |
[no-subagents sibling](https://huggingface.co/datasets/semianalysisai/cc-traces-weka-no-subagents-051826),
|
| 178 |
-
|
| 179 |
|
| 180 |
-
1. `utils/sample_proxy_traces.py --min-trace-version 5 --min-main-turns 20 --privacy-mode anon`
|
| 181 |
-
2. `utils/proxy_to_weka.py` (subagent grouping per
|
| 182 |
-
|
| 183 |
-
3. Concatenate the resulting weka JSONs into `traces.jsonl` — one trace
|
| 184 |
-
per line.
|
| 185 |
|
| 186 |
-
The same-
|
| 187 |
-
variants safe to A/B compare for any benchmark that cares about
|
| 188 |
-
|
|
|
|
| 23 |
|
| 24 |
# CC Traces — Weka, With Subagents, v5 only (May 18 2026)
|
| 25 |
|
| 26 |
+
A collection of **98 multi-turn agentic traces** drawn from real production
|
| 27 |
+
traffic against Claude Code CLI ≥ 2.1.139. Each trace captures the full
|
| 28 |
request/response sequence of a single agent session, including per-request
|
| 29 |
KV block hashes AND the original sub-agent fan-out structure (Task-tool
|
| 30 |
spawned sub-agents grouped into `WekaSubagentEntry` blocks).
|
| 31 |
|
| 32 |
+
**With-subagents, v5-only, CC ≥ 2.1.139 variant.** Companion to
|
| 33 |
[cc-traces-weka-no-subagents-051826](https://huggingface.co/datasets/semianalysisai/cc-traces-weka-no-subagents-051826),
|
| 34 |
+
which is the same 98 traces with all `WekaSubagentEntry` blocks stripped.
|
| 35 |
|
| 36 |
+
Three filters:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
1. **v5 only.** Every replayable request in every included session has
|
| 39 |
+
`trace_version = 5` (latest proxy schema, o200k_base tokenizer).
|
| 40 |
+
2. **Claude Code CLI ≥ 2.1.139.** Every successful request in every
|
| 41 |
+
included session is on a CC build that ships the
|
| 42 |
+
`x-claude-code-agent-id` HTTP header — the canonical signal sub-agent
|
| 43 |
+
grouping depends on. Sessions without it would have unreliable
|
| 44 |
+
grouping (legacy stretch-based fallback can mis-group concurrent
|
| 45 |
+
same-label sub-agents) and are excluded entirely.
|
| 46 |
+
3. **≥ 20 main-agent turns** post-strip. Sub-agent fan-out is on top of that.
|
| 47 |
+
|
| 48 |
+
- **Traces:** 98
|
| 49 |
+
- **Top-level entries:** 23,443 (22,822 main turns + 621 subagent groups)
|
| 50 |
+
- **Sub-agent inner requests:** 16,332
|
| 51 |
+
- **Total individual model requests:** 39,154
|
| 52 |
- **Models:** `claude-opus-4-7`, `claude-haiku-4-5-20251001`, `claude-opus-4-6`, `claude-sonnet-4-6`
|
| 53 |
- **KV block size:** 64 tokens
|
| 54 |
+
- **Hash scope:** `local`
|
|
|
|
| 55 |
|
| 56 |
+
## Sub-agent grouping
|
| 57 |
|
| 58 |
+
Identical algorithm to the proxy dashboard's
|
| 59 |
+
[`buildRequestRuns`](https://github.com/SemiAnalysisAI/semianalysis-claude-code-proxy/blob/main/packages/app/src/lib/subagent-runs.ts).
|
| 60 |
+
Two passes over chronologically-sorted DB rows:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
+
1. **Pre-collect header-keyed groups:** for every row with
|
| 63 |
+
`x-claude-code-agent-id`, gather ALL rows with the same id into one
|
| 64 |
+
group across the entire session (not just contiguous stretches).
|
| 65 |
+
Background sub-agents that overlap with main-agent turns collapse
|
| 66 |
+
correctly.
|
| 67 |
+
|
| 68 |
+
2. **Emit chronologically:**
|
| 69 |
+
- `subagent_label IS NULL` → main turn at position
|
| 70 |
+
- has agent-id, first sighting → emit the pre-collected group
|
| 71 |
+
- has agent-id, already emitted → skip
|
| 72 |
+
- has label but no agent-id → fallback contiguous-stretch grouping
|
| 73 |
|
| 74 |
+
For CC ≥ 2.1.139 all groups go through the header-keyed path; the
|
| 75 |
+
fallback isn't exercised. That's why we require CC ≥ 2.1.139 — the
|
| 76 |
+
fallback can mis-group concurrent same-label sub-agents.
|
| 77 |
|
| 78 |
+
## Tokenizer caveat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
+
`in` and `hash_ids` are in proxy tokenizer (`o200k_base`). Anthropic
|
| 81 |
+
reports ~60 % of the o200k count for the same content. ISL numbers
|
| 82 |
+
are bigger than what Anthropic would bill, but self-consistent between
|
| 83 |
+
`in` and `hash_ids` for cache-hit simulation.
|
| 84 |
+
|
| 85 |
+
## What's in each trace
|
| 86 |
+
|
| 87 |
+
Top-level: `id`, `models`, `block_size: 64`, `hash_id_scope: "local"`, `requests: list`.
|
| 88 |
|
| 89 |
### Main-agent request (`type: "n"` or `"s"`)
|
| 90 |
|
| 91 |
+
| field | type | description |
|
| 92 |
+
|---|---|---|
|
| 93 |
+
| `t` | float | seconds since trace start |
|
| 94 |
+
| `type` | str | `n` (non-streaming) or `s` (streaming) |
|
| 95 |
+
| `model` | str | target model |
|
| 96 |
+
| `in` | int | input tokens (proxy tokenizer) |
|
| 97 |
+
| `out` | int | output tokens |
|
| 98 |
+
| `hash_ids` | list[int] | per-trace local block IDs |
|
| 99 |
+
| `api_time` | float | end-to-end server seconds |
|
| 100 |
+
| `think_time` | float? | gap from previous request's end |
|
| 101 |
+
| `ttft` | float? | streaming only |
|
| 102 |
|
| 103 |
### Sub-agent group (`type: "subagent"`)
|
| 104 |
|
| 105 |
+
| field | type | description |
|
| 106 |
+
|---|---|---|
|
| 107 |
+
| `t` | float | start of the group |
|
| 108 |
+
| `type` | str | `"subagent"` |
|
| 109 |
+
| `agent_id` | str | stable id (slug + 8-char suffix from `x-claude-code-agent-id`) |
|
| 110 |
+
| `subagent_type` | str | `"Subagent"` for CC ≥ 2.1.139 |
|
| 111 |
+
| `duration_ms` | int | first→last inner wall-clock |
|
| 112 |
+
| `total_tokens` | int | Σ(in+out) across inners |
|
| 113 |
+
| `tool_use_count` | null | not tracked |
|
| 114 |
+
| `status` | str | `"completed"` |
|
| 115 |
+
| `requests` | list | inner Shape-A entries (all `type: "n"`) |
|
| 116 |
+
| `models` | list[str] | distinct models inside |
|
| 117 |
+
|
| 118 |
+
Inner requests carry **absolute `t` values**, so flattening + chronological
|
| 119 |
+
re-sort works directly: `sorted(main + flatten(inner), key=lambda x: x['t'])`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
## Summary statistics
|
| 122 |
|
| 123 |
+
Across **all** requests (main + sub-agent inner = 39,154):
|
| 124 |
|
| 125 |
| | p50 | p75 | p90 | p95 | p99 | mean |
|
| 126 |
|------------------------------|---------:|---------:|---------:|---------:|---------:|---------:|
|
| 127 |
+
| ISL (tokens) | 103,026 | 231,708 | 440,033 | 573,767 | 799,819 | 173,073 |
|
| 128 |
+
| OSL (tokens) | 223 | 476 | 1,152 | 1,907 | 5,413 | 527 |
|
| 129 |
+
| Top entries/trace | 126 | 304 | 571 | 733 | 1,120 | 239 |
|
| 130 |
|
| 131 |
## Plots
|
| 132 |
|
| 133 |
### Main-agent stream
|
| 134 |
|
| 135 |
+
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).
|
|
|
|
| 136 |
|
| 137 |

|
| 138 |

|
| 139 |
|
| 140 |
### Sub-agent fan-out analysis
|
| 141 |
|
| 142 |
+
Histograms across all 621 sub-agent groups and their 16,332 inner requests.
|
| 143 |
|
| 144 |

|
| 145 |

|
| 146 |
|
| 147 |
+
Six panels: groups per trace · inner requests per group · group wall-clock duration · group total tokens · inner-request ISL · intra-group cache hit rate.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
|
| 149 |
## Model composition
|
| 150 |
|
| 151 |
| model | requests (main + subagent inner) |
|
| 152 |
|-------|---------:|
|
| 153 |
+
| `claude-opus-4-7` | 38,058 |
|
| 154 |
| `claude-haiku-4-5-20251001` | 702 |
|
| 155 |
| `claude-opus-4-6` | 343 |
|
| 156 |
+
| `claude-sonnet-4-6` | 51 |
|
| 157 |
|
| 158 |
## Source
|
| 159 |
|
| 160 |
Same proxy → weka pipeline as the
|
| 161 |
[no-subagents sibling](https://huggingface.co/datasets/semianalysisai/cc-traces-weka-no-subagents-051826),
|
| 162 |
+
without the post-step that strips `WekaSubagentEntry` blocks.
|
| 163 |
|
| 164 |
+
1. `utils/sample_proxy_traces.py --min-trace-version 5 --min-main-turns 20 --require-cli-min 2.1.139 --privacy-mode anon`
|
| 165 |
+
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))
|
| 166 |
+
3. Concatenate the resulting weka JSONs into `traces.jsonl` — one trace per line.
|
|
|
|
|
|
|
| 167 |
|
| 168 |
+
The same-98-trace contract with the no-subagents sibling makes the two
|
| 169 |
+
variants safe to A/B compare for any benchmark that cares about sub-agent
|
| 170 |
+
fan-out's impact on cache-hit-rate or throughput.
|
plots/distributions_linear.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
plots/distributions_log.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
plots/subagent_distributions_linear.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
plots/subagent_distributions_log.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
traces.jsonl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fea00ec35ac395c830683d1e5b38a4809c77d4eb32c6305a9f28804fa7d3c941
|
| 3 |
+
size 674903956
|