# Get started (/docs) Two steps on one machine: start the recorder, then point your agent's existing OpenTelemetry exporter at it. What each step does, what the recorder reads, the agent-driven variant, and how it stays up and current. Sessionist records every run your agent makes, on your machine, as it happens: every prompt, every tool result, every reply, exactly as they were. You read the recording, or your coding agent does over MCP. Getting there is two steps; [reading a run](/docs/reading-a-run) is the next page. ## Step one: start the recorder [#step-one-start-the-recorder] ```sh npx sessionist ``` This starts the recorder (an OTLP receiver on `127.0.0.1:4318` and a viewer on `127.0.0.1:4319`) and, once, offers to attach your coding agent: it registers the MCP server with Claude Code, installs the connect skill, and starts the recorder at login. Node 22.16 or newer (22.16+ or 24+). The store is Node's built-in SQLite, so there is no native code and nothing compiles on install. ## Step two: connect your agent, in its repo [#step-two-connect-your-agent-in-its-repo] ``` /sessionist-connect ``` Typed into your coding agent, in the repository of the agent you want recorded. The skill finds whatever already owns telemetry in that repo, adds one OpenTelemetry exporter pointed at the recorder, asks before turning on content capture, runs the agent once, and reads the session back over MCP to prove it landed. It installs nothing, never creates a second tracer provider, and leaves an already-connected repo alone. There is no Sessionist SDK. That's it. The next run is recorded as your agent makes it. ## Already emitting OpenTelemetry? You're done. [#already-emitting-opentelemetry-youre-done] Point the exporter your agent already has at `OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4318` and change nothing else. Protobuf and JSON are both accepted, traces and logs, gzip included. - **On a framework that emits the current OTel GenAI conventions?** Turn on content capture, which most frameworks keep off. Any language. - **What exactly does it read?** Structure from `gen_ai.operation.name`; content from `gen_ai.input.messages` and `gen_ai.output.messages`. - **Already sending traces to a hosted backend?** Keep it. Add a second exporter, or fan out from your collector. Sessionist is a layer beside what you run, not a replacement. - **Emitting something older?** Kept verbatim as passthrough steps. Never dropped, never interpreted. ## If a coding agent is doing the install [#if-a-coding-agent-is-doing-the-install] A bare `npx sessionist` in an agent's shell is a foreground process that stops when the agent moves on. Have the agent run this instead: ```sh npx -y sessionist setup ``` It attaches everything, starts the recorder at login, and exits. `npx sessionist --yes` does the same and keeps serving. For an agent other than Claude Code, `npx sessionist setup --print` emits the MCP config block to paste into its settings; the server hands any MCP client its own reading order on connect, so nothing else is installed to read. ## Keeping it recording [#keeping-it-recording] The recorder is a plain process, and a run that happens while it is stopped is lost: the exporter's connection is refused in your agent, not here. `sessionist service install` starts it at login instead, a LaunchAgent on macOS or a systemd user service on Linux, with lingering enabled by default so a headless box survives logout. It relaunches after a crash and never after you stop it on purpose. `sessionist service status` reports installed, loaded, and answering separately, because they are three different things. ## Staying current [#staying-current] `npx sessionist` resolves the newest release each time it starts, so the reader your coding agent starts is current at every new session, and the recorder is current from its next start. `npx sessionist update` restarts the recorder now and refreshes the skill; it refuses while a run is recording unless you pass `--now`. When the reader and the recorder are different versions, the reader tells your coding agent, which tells you. A global install (`npm i -g sessionist`) gets new code from `npm i -g sessionist@latest`, then the same `sessionist update`. The login service and your coding agent both start Sessionist through one small launcher script that Sessionist owns, `~/.sessionist/bin/sessionist`, so nothing outside that file knows where the package is installed. Moving to a new Node version, or reinstalling somewhere else, can break only that file, and `sessionist update` run from the new install repairs it, restarts the recorder, and checks that it answers. If the old install is still there and still works, `update` leaves the service on it and says so; `sessionist setup`, run from the install you want, switches. One limit: a coding agent started from the Dock has no shell PATH, so after a Node move that deletes the old install its reader cannot start until `sessionist update` has run once. Upgrading from a release before 0.2.0: `sessionist update` moves that setup onto the launcher and keeps every recorded session. Every command accepts `--json`. `--help` and `--version` print and exit without starting anything. Every page here is also served as Markdown at its URL plus `.md`, and all of them at [`/docs/llms-full.txt`](/docs/llms-full.txt). # Reading a run (/docs/reading-a-run) The seven MCP tools your coding agent reads with, the order the server hands it, what the viewer shows, and how to hand a run to someone else. A recorded run is read two ways: by your coding agent over MCP, and by you in the local viewer. Both read the same store through the same Query API, so nothing one of them shows is hidden from the other. ## Ask your coding agent [#ask-your-coding-agent] The MCP server is read-only and carries seven tools, which mirror the Query API one-to-one: | Tool | What it answers | |---|---| | `list_sessions` | which run; always bounded by status, a time window, or text, and every answer carries the store's totals so an empty page is never mistaken for an empty store | | `get_session` | what happened in that run: one compact timeline, a line per step with its type, name, status, duration, and payload size | | `get_event_payload` | exactly what one step saw or returned, by sequence number; bodies are capped and truncation is labelled, with the total size, so the agent raises the cap only for the step that matters | | `search_sessions` | did this string appear anywhere, across names and payloads | | `export_session` | the run as a session file, to hand over | | `reads_summary` | how much has been read from this store, by which client, in how many bytes | | `sessionist_info` | whether Sessionist itself is healthy: reader and recorder versions, store path and counts, the login service | On connect, the server hands the agent its own reading order as its instructions, so there is nothing to install to read. The typical question takes three or four calls: one list, one timeline, then only the one or two payloads the answer hinges on. The agent is told not to list again to survey the store and not to read every payload in a run. Every tool response is counted by size in a local reads table, never by content. The viewer shows it as an odometer of how much your coding agents have read, and `reads_summary` exposes the same numbers over MCP. For Claude Code, `sessionist setup` registers the server. For any other MCP client, `sessionist setup --print` emits the config block. ## Or look yourself [#or-look-yourself] The run you weren't watching, step by step, with the exact bytes: the same recording your coding agent reads. The viewer at `127.0.0.1:4319` shows: - **Timeline.** Scrub the run, jump to errors. - **Step inspector.** The exact input and output of any step, however large. - **Context diff.** What the model's context gained, lost, or truncated since the last call. - **Live.** Sessions append as the agent runs. - **Deep links.** Any session, any step. - **Honest badges.** Partial capture says so on its face. What you will not see: an invented value. If a field was not in the telemetry it is absent, not defaulted. Unrecognised telemetry is kept verbatim as a plain step and labelled as such. A session grouped without a conversation id is labelled as grouped by an idle gap, so the grouping is read as approximate. Nothing can be edited. ## Hand it over as a file [#hand-it-over-as-a-file] `sessionist export ` writes a plain `.session.jsonl` file that any agent reads without a server. The format is public and versioned, with a byte-equal round trip, so your data is yours in a format you can read with `cat`. `sessionist import ` brings a file into a store, on this machine or someone else's, where the viewer and a coding agent read it like any other run.