Reference
Data directory
Where Dive keeps sessions, runs, tool shapes and the workbench log.
Dive keeps its runtime state in one directory, ~/.local/share/dive by default. Set settings.data_dir to move it. Dive creates the directory the first time it needs it.
Layout
| Path | Contents |
|---|---|
FORMAT | The directory's file version, as a single number. |
sessions/<id>/session.json | A session's kind (chat or plan), title, who started it (tenant, owner, deployment, environment), the agent it started with and the active one, the plan for a plan session, the project it was started in, its attachments, its message count, the run that holds it (active_run), and the process running that run (lease_holder, lease_generation, lease_expires_at). |
sessions/<id>/entries.jsonl | A session's history, one entry per line, each belonging to one run. |
sessions/<id>/spans.jsonl | A session's trace: every call each turn made, at any depth, one span per line. |
sessions/<id>/.lock | A lock file that keeps concurrent writers in order. |
runs/<run_id>.json | One run: its session, kind, status, the first_seq and last_seq of its entries, trace id, whether a cancel was asked for and by whom, who started it, and when it started and ended. |
threads/ | Conversations from data directories before version 5, left as they were when Dive converted them into sessions. Dive no longer reads them, and a later release will stop keeping them. Storage usage counts sessions and runs, not this folder. |
serve/dev-key.pem | The development key dive serve --dev-key signs and trusts, and the key the run tokens of dev identities are signed with, created on first use. Only for development. |
serve/dev-key.pub.pem | The development key's public half, for an app that checks those tokens. dive dev key prints it. |
files/<hash>.<ext> | Files that tools return and that you attach, such as images, named by a SHA-256 hash of their contents. Only when [storage.files] keeps files on disk, the default. |
cache/files/<hash>.<ext> | Files downloaded from an S3 bucket, kept to 512 MB by dropping the least recently used. Safe to delete. |
shapes/<tool>.json | The observed output of one tool: an inferred schema, an example, and how many times it was seen. |
workbench.log | The workbench's log, appended across sessions. |
Every file is plain JSON or JSONL, so cat and jq can read it. Session IDs are 12 hex characters and run IDs are UUIDs. In a shape or run file name, any character other than a letter, digit, _, . or - is percent-encoded.
Sessions and runs
A session is a chat (dive ask, dive chat, the workbench) or a plan run (dive plan run, the MCP server's dive_plan_run, a workbench test run). Each turn of a chat, and each plan run, is one run of its session.
- A session has at most one run at a time. A run claims the session when it starts, and a second turn while one is running is refused as busy.
- The process running a run holds a lease on it, renewed every 10 seconds and good for 30. Every write the run makes checks that the lease is still its own. A process that can't renew for 25 seconds stops its run and writes nothing more.
- When a lease runs out because its process stopped, the next Dive to open the data directory closes the run: a chat turn as
failed, a plan run asinterrupted. An interrupted plan run keeps its session. - A cancel asked for from another process is stored on the run. The process running it sees the request at its next renewal and stops after the tool call in progress. When no process holds the run, the cancel closes it straight away.
Session projects
session.json records the project a session was started in under project: the absolute path of the project's root folder, with symlinks resolved. A folder is a project when it has a .dive folder. A session started anywhere else, or in ~/.config/dive, is global and has no project, and so does every conversation written before projects were recorded. dive session list lists the current directory's sessions; --all lists them all.
Session attachments
session.json lists the things a session works on under attachments, left out when there are none. Each attachment has a kind, plus fields of its own. A session carries at most one attachment of each kind.
| Kind | Fields |
|---|---|
network | The network draft of tools, plans and agents the drafting agents build in the session, or the existing items an edit session changes. state is open, saved or discarded, and saved, when present, says what was written where. opened, when present, lists the items the session was opened on, each with its kind (agent, plan or tool) and name. The draft itself isn't stored: the opened items are read from their files and the edits are rebuilt from the session's entries when the session is opened again. |
evidence | The call an edit session is about, copied from the session it came from so it outlives that session: thread, the source session's id; call, the call's id, when there is one; item, the agent, plan or tool it concerns, with its kind and name; input; output or error; trace, when the source session recorded one: every plan, agent and tool call inside the call, and each model call an agent made, with its step path and the start of its output; turn, true when the edit is about a whole turn, whose input is the user's message and output the reply; and focus, when the user pointed at one step or model call inside it: its span, name, step path as step, model for a model call, the editable item it is when it is one, and its own input and output or error. A step's evidence is the call of the plan or agent that ran it, with the step as its focus. |
A session gets an attachment only when something loads one: an agent calls builtin__create_network (a blank draft), builtin__open_network (an existing agent, plan or tool) or builtin__attach_evidence (a call from another session), or you open an edit session, which loads the items to edit and, when the edit started from a call, that call as evidence. Every agent active in the session sees what's loaded.
Session entries
Each line of entries.jsonl is one entry, written as soon as it finishes. Every entry has these fields:
| Field | Contents |
|---|---|
seq | The entry's position in the session, counting from 1. A run's entries are one unbroken range. |
run_id | The run the entry belongs to. |
path | Where in the run the entry was written, left out at the top level. A subagent's messages have agent:<name>. |
parent | The seq of the entry this one belongs under, such as the agent_started entry of the subagent that wrote it. |
at | When the entry was written, in epoch milliseconds. |
author | user, run, or the name of the agent that wrote the entry. |
kind | What the entry is. The remaining fields depend on the kind. |
| Kind | Fields |
|---|---|
run_started | The first entry of every run: its input (the user's message, or a plan's input), identity (user, tenant, deployment, environment), trace_id when there is one, plan with the plan file for a plan run, and synthetic: true on the runs Dive made when it converted an older data directory. |
run_ended | The last entry of every run: status (completed, failed, cancelled or interrupted), outcome (the reply or the plan's output), error, and run_usage, the run's token and cost totals. |
message | A message: the user's, a model reply or a tool result, in message. |
handoff | One agent handing the conversation to another: from, to, message and via. |
agent_started, agent_finished | A subagent call: agent, caller and input when it starts, then its messages with the path agent:<name>, then agent, output and final when it ends. |
cancel_requested | Someone asked to cancel the run: by. |
step_started, step_finished | A plan step starting and finishing: step (its id, such as E3 or E3/do.2/E10), then tool and the rendered input when it starts, and output and is_error when it finishes. The entry's path is step:<id>, prefixed with plan:<name>/ for each plan the step was called from. Only runs started by dive serve write them for now. |
plan_started, plan_finished, item_started, item_finished, tool_called, ask, answer, compaction, run_resumed | Reserved for the steps of plan runs and later features. Dive doesn't write them yet. |
A user's message entry carries images when images were attached to it: their file references, such as blob:sha256-….png. Dive loads those files and sends them to the model with the message on every turn.
A message entry written by an agent's turn can also carry:
| Field | Contents |
|---|---|
ms | On a model reply, how long the model call took. On a tool result, how long the tool call took. In milliseconds. |
usage | On a model reply only: model, the model that answered, plus input_tokens, output_tokens, cache_creation_input_tokens and cache_read_input_tokens for that call. |
span_id | On a model reply, the span of the model call that wrote it. On a tool result, the span of the tool call. On agent_started, the span of the call that ran the subagent. See Session traces. |
These fields are left out when Dive has nothing to record: on user messages, handoffs, and entries written before Dive recorded them.
An agent's next turn reads the messages and handoffs of the runs that completed, plus the run in progress. The entries of a failed or cancelled run stay in the log but never reach the model again.
Session traces
Each line of spans.jsonl is one finished span, shaped like an OpenTelemetry span. Each turn is one trace: its root span is the turn, and every model call, tool call, plan, plan step and subagent the turn ran is a span under it, at any depth. Spans are written when the turn ends, including the spans a failed turn finished.
| Field | Contents |
|---|---|
trace_id | 32 hex characters, shared by every span of one turn. |
span_id | 16 hex characters. Entries name their span by this id. |
parent_span_id | The span this call was made from, left out on a turn's root. |
name | The tool or agent name, chat <model> for a model call, or the active agent's name on the root. |
kind | turn, agent, plan, tool or model. |
start_time_unix_nano, end_time_unix_nano | When the call started and ended, in nanoseconds since the epoch. |
status | code, ok or error, and on an error, its message. |
attributes | Facts about the call, named after the OpenTelemetry generative AI conventions where one fits: gen_ai.operation.name, gen_ai.tool.name, gen_ai.tool.call.id, gen_ai.agent.name, gen_ai.request.model, gen_ai.provider.name and the gen_ai.usage.* token counts, plus dive.role, dive.site, dive.cost_usd, dive.step.path and dive.plan.stack. A call that fixes another call's structured output has dive.role repair and the validation error that started it in dive.repair.reason. |
input, output | What the call was given and what it returned: a tool's arguments and result, a step's rendered input and result, a turn's message and reply. Model calls don't keep theirs. Kept only while trace.content is on, and clipped only when trace.clip_bytes is set. |
Share a directory between processes
Several Dive processes can use one data directory at the same time. Whole files are written to a temporary file and renamed into place, so a reader never sees a partial write. Writes to a session are serialized by its lock file, and a run's writes check its lease first. When two processes record the same tool shape, the last write wins.
Keep the directory on a local filesystem. File locks aren't reliable on network filesystems such as NFS.
Back up and reset
- To back up your state, copy the directory.
- To discard learned shapes, delete
shapes/. Dive records them again as tools run. - To delete a session, use
dive session rm. It also removes the session's runs and the files infiles/that no other session refers to. Files in an S3 bucket are kept, since sessions on another machine may refer to them.