This page describes Agent Journal 1.11.0 (1.x). It does not apply to 2.0, the current line on main, which has a different format; see Which Journal do I need?.
gemini-cli-sdk published with Agent Client.
Both require a Java 21 runtime, because those SDK dependencies are published as Java 21 bytecode.
The Grok, Codex, Antigravity, and Junie adapters parse their CLI’s durable JSONL directly and carry no vendor SDK dependency, so they run on Java 17 like journal-core.
All four produce an ordered tool trajectory; Gemini does not.
Every module turns one agent call into the same journal shape: a run with a prompt event, one llm_call with the call’s token usage and cost, one tool_call per tool use with the tool’s own input map, and a step_cost per step in the analysis log.
The differences are in what each CLI reports:
A cost of 0 with
costAvailable=false in the llm_call metadata means the CLI reported no cost, not that the call was free; see Cost provenance.
Sub-agent capture for Claude Code and Codex has its own guide: Sub-agent Capture.
events.jsonl and analysis.jsonl start with a header line that carries the schema version and, since 1.11.0, the producer version, so a reader can tell which release wrote a record; feedback.jsonl has no header, and a portable trace file has its own header with its own schema version.
Claude Code
Add the adapter:SessionLogParser converts an Iterator<ParsedMessage> from the Claude Code SDK into a PhaseCapture.
Despite its name, it reads the live SDK message stream, not a session log file.
The six-argument overload also writes a portable trace and controls modeled and raw content independently:
response is an Iterator<ParsedMessage> returned by the SDK and promptText is the exact prompt or null.
Record the capture into a durable journal with RunRecorder:
finish() on the success path.
Since 1.11.0 only finish() records a completed run: close() cannot tell a normal exit from an exception leaving the block, so a recorder closed without finish() ends its run CRASHED.
A plain Run is unchanged; its close() still ends it FINISHED.
The recorder writes execution events to events.jsonl and per-step cost attribution to analysis.jsonl.
It fails at finish when it produced derived events but the configured backend does not persist them durably, and it ends the run before throwing.
Call lenient() only when losing the derived stream after process exit is intentional.
Record once
To record an execution at most once per experiment and storage root, even across a restart, userecordOnce instead of creating the run yourself:
outcome.runId() is the run that records the execution and outcome.recordedNow() is false when an earlier, complete recording was found.
The run carries the execution’s key (capture.sourceKind, capture.sourceKey); the same source processed again writes nothing, a later prompt of the same session records normally, and an earlier recording that has not ended or ended with an error fails explicitly.
recordOnce needs a capture with a session id and per-turn message ids, which parse over the live SDK stream provides.
Multi-prompt sessions
Claude Code reportstotal_cost_usd, modelUsage and duration_api_ms on every result line as the session’s running total, while usage, duration_ms and num_turns cover the query alone.
A caller that records one phase per prompt in one session rebases each later capture onto the previous one:
sessionCost(), and is recorded with costBasis=session_delta and sessionCumulativeCostUsd in the LLM call’s metadata.
It never subtracts across session ids and leaves a capture unchanged when the counters restarted.
parse itself is unchanged, so a record without costBasis from a later prompt carries the running total.
Gemini CLI
Add the adapter:GeminiSessionParser converts the Gemini SDK’s synchronous QueryResult into a GeminiPhaseCapture:
result is a QueryResult and run is an open Agent Journal Run.
Configure JsonFileStorage if the derived StepCostEvent must survive process exit.
Gemini’s typed SDK exposes result-level text, usage, cost, duration, model, and status, but it does not expose per-tool calls.
The adapter therefore records one turn-level step and does not invent tool detail.
It has no TraceRawMode because the typed Gemini message does not retain a verbatim wire envelope.
Grok CLI
Add the adapter:GrokSessionParser reads Grok’s ACP-shaped streaming-json output from a file or a BufferedReader:
tool_call and tool_call_update records by toolCallId, keeping both the tool name Grok reports and its ACP semantic kind.
Grok’s stream carries a real session cost in end.total_cost_usd but no durable join from a turn to the tools it ran, so the session total is retained and attributed evenly across the captured tool steps.
Codex CLI
Add the adapter:CodexSessionParser reads a durable Codex rollout JSONL file, or, since 1.11.0, the root rollout together with the child rollouts of the sub-agents it started:
CodexRollouts; each child becomes a linked run.
CodexRunRecorder.recordOnce records the execution at most once, keyed by the root thread id.
See Sub-agent Capture for the collection, linkage, status and accounting rules.
exec, which would collapse every step into one undifferentiated name.
The parser deliberately classifies the nested payload.input call instead, extracting exec_command arguments without evaluating them and assigning semantic names such as Search, Read, Inspect, Test, Build, and Git.
The classifier is conservative about shell syntax.
Aliases, shell functions, quoted operators, and work hidden behind an interpreter fall back to
Shell.
The raw input and command are retained on the record, so callers can reclassify them later.inputTokens excludes cached input, as for every other provider; an older value converts exactly by subtracting cacheReadTokens.
A function_call tool call is recorded under its own name with its arguments kept verbatim, and a tool call that exited with code 0 is not marked failed.
Antigravity CLI
Add the adapter:AntigravitySessionParser reads Antigravity’s streaming JSON:
step_index and handles both DONE and ERROR steps, recording parameters, output or error text, duration, and terminal token usage.
Stable identities are derived from the conversation and step positions.
Antigravity’s stream reports no monetary cost: the recorder writes a cost of 0 marked costAvailable=false with an unreported source, while each step’s measured duration and the terminal token usage are recorded as reported.
Junie CLI
Add the adapter:JunieSessionParser reads Junie’s durable session trace, ~/.junie/sessions/<sessionId>/events.jsonl, from a file or a BufferedReader:
stepId as a step’s status progresses, so the parser folds every update for a step into one record rather than counting lines.
Junie reports no tool name; the record keeps the block event kind that described the step (TerminalBlockUpdatedEvent, ViewFilesBlockUpdatedEvent, FileChangesBlockUpdatedEvent, or ToolBlockUpdatedEvent) and maps it to an execute, read, edit, or other tool kind.
The parser reads both the plain-CLI and the Agent Client Protocol shapes of the trace.
Junie’s trace includes an event carrying the agent’s environment variables, unredacted.
The parser deliberately drops that event, so none of it reaches the capture or the journal.
Cost provenance
Neither Codex nor Antigravity reports monetary cost in these streams. Their cost records are zero-valued and explicitly markedcostAvailable=false with an unreported source, so a downstream reader can distinguish “this run cost nothing” from “this CLI never said.”
Token counts and measured durations are recorded for both; only the dollar figure is unknown.
A Claude Code sub-agent’s llm_call is also zero-valued with costAvailable=false, but its source is included_in_parent: the parent’s cost already contains it.
Claude Code and Gemini report a cost for the call and their llm_call events carry it without a costAvailable key.
Junie does report cost: its records are marked costAvailable=true with a reported source when the trace carries per-call costs.
Like Grok, Junie reports a session total but no per-step cost, so its per-step StepCostEvent shares are an even split of that total.
A Grok, Codex or Junie tool call whose duration was not measured records durationMs as -1 since 1.11.0 (earlier versions wrote 0).
Portable trace modes
TraceContentMode controls content bodies on modeled trace lines:
TraceRawMode is Claude-only and orthogonal:
Two schemas
Do not conflate the two JSONL formats:- Canonical journal streams use
@typeand currently have schema version 1. - Portable capture traces use
type,ts, andseqand currently have schema version 2.