Session collection for AI coding agents — reads what agents write to disk and normalises it into one session model.
pip install openaidr==0.6.0 Copy PIP instructions
OpenAIDR reads the session state AI coding agents already write to disk and normalises it into one session model with stable span identity.
Status: beta, on PyPI. Two agent kinds read today (claude-code, devin). Start with Install and run, then What OpenAIDR reads, and what it emits if you want to know what leaves your machine before you run it. (Nothing does.)
Today it reads two kinds: Claude Code and Devin (devin, which covers Devin CLI, Devin Desktop's local agent and editors driving it over ACP: one agent, one session store). Codex and Cursor are the intended next kinds and are not read yet — a session from either is absent from the output entirely, not collected and marked. The parsing dependency supports more formats than this package instantiates, which is a distinction worth holding onto; what each additional kind would cost is measured in Agent kind coverage.
It answers what an agent did, never what that means. No scoring, no identity resolution, no findings, no upload path. Interpreting a session is a consumer's job; OpenAIDR takes no position on what a consumer concludes.
OpenAIDR reads files the agent already wrote — Claude Code's JSONL transcripts and its per-server MCP connection logs — opened read-only. No process hooks, no proxy, no injected agent, no listener, and nothing is written back.
There is no upload path at all. OpenAIDR reads, normalises and returns a model. It opens no network connection and ships nothing anywhere. What a consumer does with the model is the consumer's decision and the consumer's boundary to state.
Transcripts contain a person's own words, the arguments they passed to tools, and the paths they work in. The session model separates that from the structural account of what happened, and the separation is enforced in code, not by convention — LOCAL_ONLY names every field that serves correlation and local rendering only.
--format json is the shape most likely to be redirected to a file, piped into another program, or pasted somewhere, so it is the narrower of the two: it carries the structural account and drops even the error text the local text surface shows. There are tests asserting that a prompt and an sk--shaped token present in a transcript reach neither surface.
One honest caveat: the boundary described above is the boundary of the CLI. The in-memory Session model does carry the LOCAL_ONLY fields, because a consumer embedding OpenAIDR as a library may legitimately need them on the machine that produced them. If you embed it, Session.public_descriptor() is the deliberately narrow shape intended to travel outward, and drawing your own boundary is your call to state.
Session parsing itself comes from Uber's ADR project (adr-sensor, Apache-2.0) — it owns the on-disk formats, and it is OpenAIDR's only runtime dependency. It is confined behind an adapter: upstream types convert at the reader boundary and never appear elsewhere. Any one agent kind can instead be backed by an OpenAIDR-owned reader on the same contract — per kind, not all-or-nothing.
What the adapter adds is not a thin wrapper. Upstream's unified event model was measured against this one rather than assumed (the full table):
The pin is exact (adr-sensor==1.0.0, not >=): the adapter reads upstream internals as well as its public entry point, and a test asserts the exact error string upstream prints, so a version bump is a deliberate re-check rather than silent drift.
uv tool install openaidr That installs an openaidr command:
$ openaidr --version openaidr 0.1.0 openaidr sessions prints what each agent on this machine actually did — sessions, turns, tool calls, and how each one ended. Per-call timings come from the transcript's own record of both ends of a call, not from the parsing dependency's event schema, which carries no timestamp below the session.
docs/specs/session-collection.md — the session model, span identity, per-agent-kind normalisation, and the collection interface. Decisions in docs/adrs/, and a doc index in docs/.
Beta. Session collection works for claude-code: sessions, turns, tool calls, and span identity, read by an OpenAIDR-owned reader that calls adr-sensor's Claude Code parser one file at a time and normalises everything upstream's shared event schema cannot express. The model has six outcome statuses; this reader emits five of them (unknown, rejected, pending, ok, error) from Claude Code's own transcripts and, for MCP calls, its per-server connection logs — interrupted is modelled but not emitted, since neither source records it.
For long-lived consumers, IncrementalCollector accepts an agent kind and one changed transcript path. It cold-reads that file once, then projects only newly appended, newline-terminated records while returning its current full session. IncrementalCollector.locations() says which directories hold each kind's session files, sub-agents included, so a consumer can watch every kind without knowing its layout (ADR-0023). The cursor is in memory only; process restart deliberately falls back to a cold read. See ADR-0011.
Why this reader walks the tree and calls adr-sensor's parser per file, rather than going through upstream's own whole-tree walk, is recorded in the spec.
Reading an agent's session log and normalising it is plumbing, and every new agent format is coverage a contributor can add without touching anything that interprets the result. That is the contribution this project is shaped around, and CONTRIBUTING.md walks the reader contract end to end — the four wiring points, then the traps that cost us an ADR each.
For a vulnerability in OpenAIDR's own code, see SECURITY.md — report privately via a GitHub security advisory rather than a public issue.
agent-security ai-security mcp observability session telemetry
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.




