File size: 12,866 Bytes
aeb931a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 | ---
pretty_name: "MIMO Claude Code Traces 1K"
language:
- en
license: mit
task_categories:
- text-generation
- question-answering
- other
tags:
- code-agent
- coding
- agent-traces
- format:json
- format:agent-traces
- tool-use
- claude
- software-engineering
- code-generation
- debugging
- refactoring
- shell
- devops
- reasoning
- distillation
- claude-fable-5
- teich
size_categories:
- 1K<n<10K
configs:
- config_name: default
data_files:
- split: train
path: "session/**/*.jsonl"
---
# MIMO Claude Code Traces
MIMO Claude Code Traces is a collection of coding-agent trajectories in a Claude Code-style environment. Each record contains a user coding task, the full multi-turn message trace, available tool schemas, assistant reasoning fields, tool calls, tool outputs, and metadata such as model name, category, duration, cost, token usage, and whether the trace used tools.
<p align="center">
<img src="images/bench.png" alt="MiMo-V2.5-Pro benchmark results" width="820"/>
</p>
The traces were generated with **`mimo-v2.5-pro`**, MiMo's most capable model at the time of release. MiMo-V2.5-Pro is a **1.02T-parameter Mixture-of-Experts model** with **42B active parameters**, a hybrid-attention architecture, and a **1M-token context window**. It is designed for agentic workloads, complex software engineering, and long-horizon tasks, with improved instruction following and coherence across ultra-long contexts. In tool-using harnesses, it can sustain complex trajectories spanning hundreds to more than a thousand tool calls.
<p align="center">
<img src="images/efficiency.png" alt="MiMo-V2.5-Pro token efficiency" width="820"/>
</p>
The dataset was produced in an agentic coding setup with tools such as `Bash`, `Read`, `Write`, `Edit`, `Glob`, `Grep`, `TodoWrite`, and planning utilities. The dataset construction process used approximately **400M tokens** in total. The released trace metadata records approximately **127.2M logged usage tokens** across input, cache-read, and output token fields.
This dataset is intended for research and training around code agents: tool-use imitation, code-agent distillation, supervised fine-tuning, trajectory modeling, reasoning/tool-call alignment, and evaluation of software-engineering task behavior.
---
## Dataset Structure
```text
mimo-claude-code-traces-1k/
+-- README.md
+-- session/
| +-- algorithms/
| | +-- *.jsonl
| +-- api_integration/
| | +-- *.jsonl
| +-- code_generation/
| | +-- *.jsonl
| +-- data_processing/
| | +-- *.jsonl
| +-- debugging/
| | +-- *.jsonl
| +-- hf_trace/
| | +-- *.jsonl
| +-- math_problems/
| | +-- *.jsonl
| +-- refactoring/
| | +-- *.jsonl
| +-- shell_devops/
| | +-- *.jsonl
| +-- supplement/
| +-- *.jsonl
```
Each `.jsonl` file contains one complete agent trace record.
---
## Dataset Overview
- **Total traces**: 1,017
- **Total JSONL files**: 1,017
- **Model**: `mimo-v2.5-pro`
- **Generation budget**: ~400M tokens used during dataset construction
- **Logged usage tokens in released metadata**: 127,236,485
- **Total Claude Code-style event rows**: 15,046
- **Conversation messages**: 11,995
- **Assistant tool calls**: 5,271
- **Tool result messages**: 5,271
- **Traces with tool calls**: 859
- **Traces with reasoning fields**: 1,017
- **Total recorded turns**: 4,932
- **Total recorded duration**: ~20.5 hours
- **Recorded API cost field total**: $163.89
Logged usage-token breakdown:
| Token field | Count |
|---|---:|
| `input_tokens` | 8,033,778 |
| `cache_read_input_tokens` | 117,286,784 |
| `cache_creation_input_tokens` | 0 |
| `output_tokens` | 1,915,923 |
| **Total logged usage tokens** | **127,236,485** |
---
## Category Distribution
| Category | Traces | Messages | Tool calls | Traces with tools | Turns |
|---|---:|---:|---:|---:|---:|
| `algorithms` | 157 | 1,853 | 722 | 148 | 854 |
| `api_integration` | 23 | 1,300 | 984 | 23 | 214 |
| `code_generation` | 213 | 3,246 | 1,429 | 213 | 1,448 |
| `data_processing` | 58 | 885 | 442 | 58 | 345 |
| `debugging` | 162 | 941 | 252 | 96 | 380 |
| `hf_trace` | 57 | 637 | 316 | 36 | 225 |
| `math_problems` | 76 | 745 | 260 | 76 | 332 |
| `refactoring` | 126 | 796 | 216 | 64 | 339 |
| `shell_devops` | 70 | 901 | 416 | 70 | 486 |
| `supplement` | 75 | 691 | 234 | 75 | 309 |
| **Total** | **1,017** | **11,995** | **5,271** | **859** | **4,932** |
### Token and Cost by Category
| Category | Logged tokens | Output tokens | Duration ms | Cost USD |
|---|---:|---:|---:|---:|
| `algorithms` | 23,302,782 | 335,330 | 12,891,693 | 29.179555 |
| `api_integration` | 5,273,760 | 52,907 | 3,989,450 | 14.793162 |
| `code_generation` | 41,079,654 | 771,091 | 24,428,456 | 51.162873 |
| `data_processing` | 8,638,826 | 112,405 | 4,548,507 | 10.566932 |
| `debugging` | 9,390,091 | 133,225 | 6,306,098 | 11.999537 |
| `hf_trace` | 4,365,211 | 82,627 | 4,164,129 | 10.435188 |
| `math_problems` | 8,867,295 | 128,300 | 5,003,409 | 9.130514 |
| `refactoring` | 8,571,921 | 101,568 | 5,166,704 | 10.012703 |
| `shell_devops` | 9,940,490 | 126,358 | 4,455,335 | 10.254762 |
| `supplement` | 7,806,455 | 72,112 | 2,985,143 | 6.351987 |
---
## Tool Use
The dataset captures explicit tool-call behavior, including successful calls and tool error messages. This makes it suitable for learning when to call tools, how to recover from failed tool calls, and how to combine shell/file operations with natural-language reasoning.
| Tool | Calls |
|---|---:|
| `Bash` | 1,805 |
| `Read` | 1,480 |
| `Write` | 919 |
| `Glob` | 381 |
| `Edit` | 339 |
| `Grep` | 163 |
| `Agent` | 53 |
| `EnterPlanMode` | 38 |
| `ExitPlanMode` | 36 |
| `AskUserQuestion` | 28 |
| `TodoWrite` | 25 |
| `TaskOutput` | 2 |
| `WebFetch` | 1 |
| `TaskStop` | 1 |
| **Total** | **5,271** |
Available tool schemas are included in every trace. The common Claude Code-style tool inventory includes:
```text
Task, AskUserQuestion, Bash, CronCreate, CronDelete, CronList, Edit,
EnterPlanMode, EnterWorktree, ExitPlanMode, ExitWorktree, Glob, Grep,
NotebookEdit, Read, ScheduleWakeup, Skill, TaskOutput, TaskStop,
TodoWrite, WebFetch, WebSearch, Write
```
---
## Event Stream Schema
Each `.jsonl` file in `session/<category>/` is one Claude Code-style event stream. Each line is one event, following the same broad shape as Claude Code trace logs.
Common top-level fields include:
| Field | Type | Description |
|---|---:|---|
| `type` | string | Event type, such as `mode`, `permission-mode`, `user`, `assistant`, `last-prompt`, or `system` |
| `sessionId` | string | Session identifier |
| `uuid` | string | Event UUID. Missing original UUIDs are deterministically generated during conversion |
| `parentUuid` | string/null | Parent event UUID for message-chain reconstruction |
| `timestamp` | string | Event timestamp |
| `cwd` | string | Working directory recorded or normalized for the trace |
| `version` | string | Dataset conversion/version marker |
| `message` | object | User, assistant, or tool-result message payload |
Assistant events store Claude-style message content blocks:
| Content block | Description |
|---|---|
| `text` | Assistant natural-language response |
| `thinking` | Reasoning content from the original trace |
| `tool_use` | Tool call with `id`, `name`, and `input` |
Tool outputs are represented as `user` events whose `message.content` contains `tool_result` blocks linked by `tool_use_id`.
Event-type counts:
| Event type | Count |
|---|---:|
| `mode` | 1,017 |
| `permission-mode` | 1,017 |
| `user` | 6,288 |
| `assistant` | 4,690 |
| `last-prompt` | 1,017 |
| `system` | 1,017 |
| **Total** | **15,046** |
### Example Event Lines
```json
{"type":"mode","mode":"normal","sessionId":"7469deea-7e45-4732-8f06-9666d52052d4"}
{"type":"user","message":{"role":"user","content":"Implement Kahn's algorithm for topological sort..."},"sessionId":"7469deea-7e45-4732-8f06-9666d52052d4","uuid":"...","parentUuid":null}
{"type":"assistant","message":{"model":"mimo-v2.5-pro","role":"assistant","content":[{"type":"thinking","thinking":"..."},{"type":"text","text":"Let me explore the codebase."},{"type":"tool_use","id":"call_...","name":"Bash","input":{"command":"ls /data/agent/choucisan"}}]},"sessionId":"7469deea-7e45-4732-8f06-9666d52052d4","uuid":"...","parentUuid":"..."}
{"type":"user","message":{"role":"user","content":[{"type":"tool_result","tool_use_id":"call_...","content":"...","is_error":false}]},"sessionId":"7469deea-7e45-4732-8f06-9666d52052d4","uuid":"...","parentUuid":"..."}
```
Some fields are normalized because the original collected data did not include the full Claude Code runtime envelope. In particular, `uuid`, `parentUuid`, `requestId`, `cwd`, `version`, and `gitBranch` are deterministic conversion fields rather than raw Claude Code runtime fields.
---
## Quick Start
### Read local files
```python
import json
from pathlib import Path
root = Path("mimo-claude-code-traces-1k")
files = sorted((root / "session").glob("*/*.jsonl"))
events = []
for path in files:
with open(path, "r", encoding="utf-8") as f:
for line in f:
if line.strip():
events.append(json.loads(line))
print(len(events))
print(events[0])
```
### Count tool calls
```python
from collections import Counter
tool_counts = Counter()
for event in events:
message = event.get("message") or {}
for block in message.get("content", []) or []:
if isinstance(block, dict) and block.get("type") == "tool_use":
tool_counts[block.get("name")] += 1
print(tool_counts.most_common())
```
### Load with Hugging Face Datasets
```python
from datasets import load_dataset
repo_id = "choucsan/mimo-claude-code-traces-1k"
dataset = load_dataset(repo_id, data_files="session/**/*.jsonl")
print(dataset["train"][0])
```
---
## Applications
### Code-Agent Distillation
- Distill `mimo-v2.5-pro` agent behavior into smaller code models
- Train models to produce structured tool calls in a Claude Code-style environment
- Learn multi-turn coding workflows from complete trajectories
- Model tool failure recovery and iterative debugging behavior
### Supervised Fine-Tuning
- Fine-tune coding assistants on task-to-trajectory data
- Train assistant response generation with or without reasoning fields
- Train tool-call prediction from user prompt and conversation context
- Train final-answer generation from intermediate tool observations
### Agentic Reinforcement Learning and Preference Modeling
- Build offline RL datasets for tool-using code agents
- Extract step-level or trace-level preferences from successful and failed actions
- Train reward models for tool choice, edit quality, or task completion
- Study cost-aware and latency-aware agent behavior using metadata fields
### Tool-Use Research
- Analyze when agents choose shell commands versus file reads/edits
- Study command sequences for debugging, refactoring, and devops tasks
- Evaluate robustness to tool errors and invalid file paths
- Benchmark tool-call parsers and function-calling policies
### Software-Engineering Task Modeling
- Debugging and bug localization
- Code generation from natural-language specifications
- Refactoring and cleanup
- API integration tasks
- Data-processing scripts
- Algorithm implementation
- Shell and devops workflows
- Math and reasoning-heavy coding prompts
---
## Data Quality Notes
- Each file in `session/<category>/` is a Claude Code-style JSONL event stream for one trace.
- All released traces report `metadata.model = "mimo-v2.5-pro"`.
- All 1,017 traces include reasoning fields.
- 859 traces include at least one tool call.
- Tool outputs may include errors, failed edits, missing files, or shell diagnostics; these are retained because they are useful for training recovery behavior.
- The dataset contains generated coding-agent traces, not verified production patches. Users should validate code before using examples as ground truth.
- The event stream is converted from normalized trace records. Some Claude Code envelope fields are deterministic reconstruction fields because the original records did not include raw runtime UUIDs or local harness metadata.
- The recorded token accounting in assistant `message.usage` reflects logged trace metadata and does not include all tokens used during the broader dataset construction process.
---
## Citation
```bibtex
@misc{zhishan_zou_2026,
author = { Zhishan Zou },
title = { mimo-claude-code-traces-1k (Revision b40c75e) },
year = 2026,
url = { https://huggingface.co/datasets/choucsan/mimo-claude-code-traces-1k },
doi = { 10.57967/hf/9879 },
publisher = { Hugging Face }
}
```
---
## Contact
For questions, corrections, or collaboration requests:
[choucisan@gmail.com](mailto:choucisan@gmail.com)
|