camsemianalsyis commited on
Commit
bdedf18
·
verified ·
1 Parent(s): f120c97

filter to CC >=2.1.139 (header-keyed grouping); +2 traces (98 total)

Browse files
README.md CHANGED
@@ -22,94 +22,54 @@ configs:
22
 
23
  # CC Traces — Weka, No-Subagents, v5 only (May 18 2026)
24
 
25
- A collection of **96 multi-turn agentic traces** (≈ 21.6 k individual
26
  model requests) drawn from real production traffic against the Claude
27
  Code CLI ≥ 2.1.139. Each trace captures the full request/response
28
  sequence of a single agent session, including per-request KV block
29
  hashes, so the dataset can be replayed against an inference engine or
30
  used to simulate prefix-cache behavior offline.
31
 
32
- **No-subagents, v5-only variant.** This dataset is a derivative of the
33
- source weka traces with two filters applied:
34
 
35
  1. **No subagents.** All `WekaSubagentEntry` blocks have been stripped —
36
  only top-level main-agent turns remain.
37
  2. **v5 only.** Every replayable request in every included session has
38
- `trace_version = 5` (the latest proxy schema). Sessions containing
39
- any earlier-format request are excluded entirely.
40
-
41
- The combined filter is stricter than the
42
- [cc-traces-weka-no-subagents-051226](https://huggingface.co/datasets/semianalysisai/cc-traces-weka-no-subagents-051226)
43
- variant: that one mixes v1–v4 traces (older qwen3-tokenizer rows)
44
- alongside v5. Use **this dataset** when the token-count accounting
45
- needs to be uniform across the corpus; use 051226 when you want a
46
- larger pool with mixed tokenizers.
47
-
48
- Also filtered: only sessions whose post-strip main-agent stream has
49
- **≥ 20 turns**. Sessions with shorter streams are excluded so every
50
- trace exercises the multi-turn replay path meaningfully.
51
-
52
- - **Traces:** 96
53
- - **Requests:** 21,566 total, mean **224.6** per trace, max **2,171**
54
  - **Models:** `claude-opus-4-7`, `claude-opus-4-6`, `claude-sonnet-4-6`
55
  - **KV block size:** 64 tokens
56
- - **Hash scope:** `local` — block hash IDs are only comparable *within*
57
- a single trace; they are not a global content-addressable identity.
58
-
59
- ## Important: tokenizer caveat
60
-
61
- The `in` field on each request and the `hash_ids` array are both
62
- measured in **the proxy's tokenizer**. v5 rows use `o200k_base`
63
- (GPT-4o family) for byte-pair encoding. Anthropic typically reports
64
- ~60 % of the o200k token count for the same content. So the ISL
65
- numbers below are larger than what the Anthropic API would have
66
- billed for the same prompt — but they're self-consistent between
67
- `in` and `hash_ids`, which is what matters for KV-cache replay
68
- simulation.
69
-
70
- If you replay these traces against a real Claude (or Claude-like)
71
- server, the server will re-tokenize the text and see ~Claude-equivalent
72
- token counts, so cache-hit-rate measurements remain accurate.
73
-
74
- ## What's in each trace
75
-
76
- Top-level trace fields:
77
-
78
- | field | type | description |
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 (main-agent only) |
85
-
86
- Each entry in `requests` is:
87
-
88
- | field | type | description |
89
- |---------------|-----------|--------------------------------------------------------------------------|
90
- | `t` | float | Seconds since start of trace |
91
- | `type` | str | `n` (non-streaming) or `s` (streaming) |
92
- | `model` | str | Target model for this request |
93
- | `in` | int | Effective prompt tokens covered by `hash_ids` (proxy tokenizer) |
94
- | `out` | int | Output tokens (Anthropic-reported) |
95
- | `hash_ids` | list[int] | Per-trace local block-hash IDs for the input, one per 64-token block |
96
- | `api_time` | float | End-to-end server time for this call (seconds) |
97
- | `think_time` | float | Wall-clock gap from previous request's end (seconds) |
98
- | `ttft` | float? | Time to first token (streaming requests only) |
99
-
100
- `hash_ids` make the dataset unusually useful for KV-cache work: the
101
- contiguous common prefix between turn *t* and turn *t − 1* exactly
102
- measures the portion of the input that a local prefix cache would be
103
- able to reuse.
104
 
105
  ## Summary statistics
106
 
107
  | | p50 | p75 | p90 | p95 | p99 | mean |
108
  |------------------------------|---------:|---------:|---------:|---------:|---------:|---------:|
109
- | ISL (tokens) | 182,115 | 345,997 | 537,070 | 675,840 | 840,000 | 243,765 |
110
- | OSL (tokens) | 216 | 576 | 1,480 | 2,555 | 6,653 | 633 |
111
- | `think_time` (s) | 1.00 | 2.75 | 12.25 | 72.31 | 472.53 | 96.41 |
112
- | Turn depth (requests/trace) | 96 | 300 | 568 | 676 | 1,140 | 225 |
113
 
114
  ![Distributions — log x](plots/distributions_log.png)
115
  ![Distributions — linear x](plots/distributions_linear.png)
@@ -118,20 +78,18 @@ able to reuse.
118
 
119
  | model | requests |
120
  |-------|---------:|
121
- | `claude-opus-4-7` | 21,195 |
122
  | `claude-opus-4-6` | 302 |
123
- | `claude-sonnet-4-6` | 69 |
124
 
125
  ## Source
126
 
127
  Derived from the SemiAnalysis Claude Code traffic proxy. Build pipeline:
128
 
129
- 1. `utils/sample_proxy_traces.py --min-trace-version 5 --min-main-turns 20 --privacy-mode anon`
130
- pulls v5-only Anthropic sessions out of the proxy DB.
131
  2. `utils/proxy_to_weka.py` converts per-session JSONL into weka-format
132
- trace JSON (with subagent grouping per the proxy dashboard's
133
- algorithm).
134
- 3. A post-step strips all `WekaSubagentEntry` blocks and drops any
135
- trace with fewer than 20 surviving main-agent turns.
136
- 4. The remaining traces are concatenated into `traces.jsonl`
137
- (one trace per line).
 
22
 
23
  # CC Traces — Weka, No-Subagents, v5 only (May 18 2026)
24
 
25
+ A collection of **98 multi-turn agentic traces** (≈ 22.8 k individual
26
  model requests) drawn from real production traffic against the Claude
27
  Code CLI ≥ 2.1.139. Each trace captures the full request/response
28
  sequence of a single agent session, including per-request KV block
29
  hashes, so the dataset can be replayed against an inference engine or
30
  used to simulate prefix-cache behavior offline.
31
 
32
+ **No-subagents, v5-only, CC ≥ 2.1.139 variant.** Three filters:
 
33
 
34
  1. **No subagents.** All `WekaSubagentEntry` blocks have been stripped —
35
  only top-level main-agent turns remain.
36
  2. **v5 only.** Every replayable request in every included session has
37
+ `trace_version = 5` (latest proxy schema, o200k_base tokenizer).
38
+ 3. **Claude Code CLI 2.1.139.** Every successful request in every
39
+ included session is on a CC build that ships the
40
+ `x-claude-code-agent-id` HTTP header the canonical signal sub-agent
41
+ grouping depends on. Sessions where any row predates this header
42
+ are excluded entirely because we can't reliably distinguish a
43
+ Task-tool sub-agent from a utility call without it.
44
+
45
+ Each remaining trace has **≥ 20 main-agent turns** post-strip so every
46
+ trace exercises multi-turn replay meaningfully.
47
+
48
+ Companion: [`cc-traces-weka-051826`](https://huggingface.co/datasets/semianalysisai/cc-traces-weka-051826)
49
+ is the same 98 traces with sub-agent fan-out preserved.
50
+
51
+ - **Traces:** 98
52
+ - **Requests:** 22,822 total, mean **232.9** per trace, max **2,171**
53
  - **Models:** `claude-opus-4-7`, `claude-opus-4-6`, `claude-sonnet-4-6`
54
  - **KV block size:** 64 tokens
55
+ - **Hash scope:** `local`
56
+
57
+ ## Tokenizer caveat
58
+
59
+ The `in` field and `hash_ids` are measured in the proxy's tokenizer
60
+ (`o200k_base`, GPT-4o family). Anthropic typically reports ~60 % of the
61
+ o200k token count for the same content so ISL numbers below are
62
+ larger than what Anthropic would bill for the same prompt, but
63
+ self-consistent between `in` and `hash_ids` for cache-hit simulation.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
 
65
  ## Summary statistics
66
 
67
  | | p50 | p75 | p90 | p95 | p99 | mean |
68
  |------------------------------|---------:|---------:|---------:|---------:|---------:|---------:|
69
+ | ISL (tokens) | 181,474 | 338,879 | 525,701 | 664,749 | 838,501 | 240,502 |
70
+ | OSL (tokens) | 212 | 569 | 1,455 | 2,499 | 6,528 | 623 |
71
+ | `think_time` (s) | 0.98 | 2.71 | 12.45 | 71.64 | 448.24 | 92.32 |
72
+ | Turn depth (requests/trace) | 110 | 300 | 568 | 730 | 1,119 | 233 |
73
 
74
  ![Distributions — log x](plots/distributions_log.png)
75
  ![Distributions — linear x](plots/distributions_linear.png)
 
78
 
79
  | model | requests |
80
  |-------|---------:|
81
+ | `claude-opus-4-7` | 22,484 |
82
  | `claude-opus-4-6` | 302 |
83
+ | `claude-sonnet-4-6` | 36 |
84
 
85
  ## Source
86
 
87
  Derived from the SemiAnalysis Claude Code traffic proxy. Build pipeline:
88
 
89
+ 1. `utils/sample_proxy_traces.py --min-trace-version 5 --min-main-turns 20 --require-cli-min 2.1.139 --privacy-mode anon`
 
90
  2. `utils/proxy_to_weka.py` converts per-session JSONL into weka-format
91
+ trace JSON. Sub-agent grouping is identical to the
92
+ [proxy dashboard's `buildRequestRuns`](https://github.com/SemiAnalysisAI/semianalysis-claude-code-proxy/blob/main/packages/app/src/lib/subagent-runs.ts).
93
+ 3. Post-step strips all `WekaSubagentEntry` blocks; traces with <20
94
+ surviving main turns are dropped (none dropped at this build).
95
+ 4. Remaining traces concatenated into `traces.jsonl` (one trace per line).
 
plots/distributions_linear.png CHANGED

Git LFS Details

  • SHA256: 2ab01e4682455729943895ffde2447f1270d829355f4326b5c4aaba02f92a660
  • Pointer size: 131 Bytes
  • Size of remote file: 211 kB

Git LFS Details

  • SHA256: dcc506971e58888585bf5dd91b3b69fb0ccdaea90a5ae42e3fc0f993de94efba
  • Pointer size: 131 Bytes
  • Size of remote file: 209 kB
plots/distributions_log.png CHANGED

Git LFS Details

  • SHA256: 371d70971a549dd004dca92486058c38fa2ab920c02e0f7dd0ef68dc8064faae
  • Pointer size: 131 Bytes
  • Size of remote file: 210 kB

Git LFS Details

  • SHA256: 06cd89588257fc34ace3a3d4af772bd5aad23f5d7612e2d7cfe6f41bc2d96dee
  • Pointer size: 131 Bytes
  • Size of remote file: 211 kB
traces.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:fe0ae6f7b987261ea05af0f328a1213a04cfdf3bf0ac7bc2808c5f0af1685178
3
- size 516326432
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2a7698312e97f52e5eaa01d9ebd7dafcd17fc8e7d1fa55c9a3aa30749a440ec
3
+ size 538929960