Agent traces
Agent traces as reinforcement learning training data
How real coding-agent sessions map onto reinforcement learning ideas like trajectories, rewards and preferences, and why recovery and human feedback are valuable.

Coding agents are increasingly trained not just to predict the next line of text but to take actions, see results and improve. That's the territory of reinforcement learning (RL), and it changes what kind of data is useful. A real coding-agent session is, in structure, very close to what RL works with: a sequence of decisions, observations and outcomes.
This guide explains that connection in plain terms, so you can understand why your sessions might be valuable and which parts matter. It's a conceptual overview, not a description of any particular lab's methods, which they generally don't publish in detail.
A quick primer on RL vocabulary
A few terms come up constantly.
- Agent. The system making decisions, here the coding model.
- Environment. What the agent acts on: your repository, terminal, test suite and files.
- Action. Something the agent does, like reading a file, running a command or editing code.
- Observation. What comes back, such as file contents, command output or an error.
- Trajectory. The full sequence of actions and observations from start to finish.
- Reward. A signal of how good an outcome was, such as tests passing.
- Preference. A judgment that one behavior is better than another, often from a human.
How a session maps onto these ideas
A coding-agent session has all of these pieces, even if no one labeled them that way.
| RL concept | In a coding-agent session |
|---|---|
| Task | Your request, in your words |
| Environment | The project, terminal and tools |
| Action | A tool call: read, search, run, edit |
| Observation | The tool's result: file contents, output, errors |
| Trajectory | The whole session, start to finish |
| Reward signal | Tests passing, a build succeeding, you confirming it works |
| Preference signal | Your corrections and approvals |
This is why traces that include tool calls and their results are much more useful than chat-only history. Without the actions and observations, there's no trajectory.
Why real trajectories are hard to get
Labs can generate trajectories by running agents on prepared tasks. That's valuable, but it has limits.
- Prepared tasks are clean. Real repositories have legacy code, missing docs, flaky tests and unusual tooling.
- Rewards are easier to define on prepared tasks. In real work, success is often judged by the developer rather than by an automated test.
- Generated trajectories reflect the model's own habits. Real sessions include humans steering the agent in directions it wouldn't have chosen.
Real sessions fill those gaps.
The most valuable moments in a trace
Recovery
When an agent runs a command, gets an error, reads it, and fixes the problem, that's a short trajectory of error recovery. Models still struggle with recovering from their own mistakes, so these sequences are particularly useful. Don't cut failed attempts out of a session before contributing it.
Human correction
"That's not what I meant." "You deleted the wrong function." "Use the existing helper instead." Each correction is a direct statement of preference. Methods that learn from human feedback depend on exactly this kind of judgment, and it's expensive to collect any other way.
Verified success
A session that ends with tests passing, a successful build or the developer confirming the fix provides a clear outcome. Clear outcomes make it easier to tell good trajectories from bad ones.
Knowing when to stop
Sometimes the right move is to ask a clarifying question or stop and report a blocker. Sessions where an agent does that, or where the developer says it should have, show behavior that's hard to teach from code alone.
Long-horizon work
Multi-step tasks such as refactors across many files, migrations or debugging that spans several components show how an agent maintains a plan over many actions. They're scarcer than one-step fixes.
What doesn't help
- Edited or curated transcripts. If you remove the messy parts, you remove much of the signal.
- Chat without actions. Useful for some purposes, but not trajectories.
- Unscrubbed secrets and personal data. Responsible buyers don't want them, and models can memorize them.
- Unclear ownership. Data whose provenance is doubtful is a liability. See is it legal to sell your AI chat history?
Scrubbing without losing the signal
There's a tension between privacy and usefulness. Remove too little and you leak secrets. Remove too much and the trajectory stops making sense.
The dataoffer tool handles this by replacing values with placeholders that are consistent within a trace. If an email appears five times, it's <EMAIL_1> all five times, so the agent's actions still make sense. Ordinary code without secrets passes through unchanged. Placeholders are numbered by order within each trace, so they can't be reversed or linked across traces. Files like .env and key files are dropped entirely, and a verification pass blocks any trace that still contains something a detector recognizes. Our guide on removing secrets and PII from agent logs goes into detail.
A unified format
Each coding agent stores sessions differently. For a buyer, sessions from sixteen tools in sixteen formats are much harder to use than the same sessions in one consistent shape. The dataoffer tool normalizes every supported harness into a single schema with messages, tool calls and tool results, so trajectories from Claude Code, Cursor, Codex, Cline and others can be used together.
What this means for value
RL-oriented buyers care about trajectory quality: completeness, real outcomes, recovery and human feedback. Token count is a rough proxy at best. Our guide on how coding-agent trace data is priced explains why any figure before a sale is only an estimate.
Consent is part of the data
For training data to be usable, buyers need to know it was contributed by someone with the right to contribute it. That's not only a legal point. Data whose origin can't be explained is harder to use and easier to challenge later. Every trace contributed through dataoffer passes through choices a person made: which tools, which projects, a typed confirmation to export and another to upload, and, for agent-run contributions, an owner's approval by email. That chain of decisions travels with the data as part of its provenance.
Frequently asked questions
Is my chat history a trajectory?
Only partly. A trajectory needs actions and observations. Sessions that include tool calls and results are trajectories; pure chat is closer to conversational data.
Do failed sessions have value for RL?
They can. A failure followed by recovery or correction shows both what not to do and how to fix it. Even unresolved failures can help, though clear outcomes are more useful.
Are my corrections really that useful?
Yes. A human saying which behavior is better is a preference signal, which is central to training approaches that learn from feedback and is costly to collect.
Do labs use traces exactly as uploaded?
We don't know any specific lab's process, and they don't generally publish it. Buyers typically filter, deduplicate and process data before use.
Will scrubbing break the trajectory?
Usually not. Consistent placeholders keep references coherent, and code without sensitive values is unchanged.
Which tools produce the richest trajectories?
Tools that record full tool calls and results, such as Claude Code, Codex and the VS Code task-based extensions, tend to produce more complete trajectories than chat-only histories.
Contribute real trajectories
If your agent history is full of real work, recoveries and corrections, it's the kind of data this field needs. Start with a no-network preview on the traces page.
Contribute your agent sessions
The dataoffer tool scrubs every session on your machine before anything leaves it. Start with a preview: it makes no network calls and writes nothing.
This guide is general information, not legal, tax or financial advice. Figures and ranges are illustrative; talk to qualified advisors about your situation.


