Skip to main content
Agent Journal provides six vendor adapters that write compatible core events and portable traces. The Claude and Gemini adapters parse a typed SDK object: Claude consumes the Claude Agent SDK for Java and Gemini the 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.

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:
Here, 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:
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. Call lenient() only when losing the derived stream after process exit is intentional.

Gemini CLI

Add the adapter:
GeminiSessionParser converts the Gemini SDK’s synchronous QueryResult into a GeminiPhaseCapture:
Here, 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:
The parser pairs 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:
Codex records most tool invocations under the outer function name 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.
Codex rollout token counts, including cached and reasoning tokens, are preserved.

Antigravity CLI

Add the adapter:
AntigravitySessionParser reads Antigravity’s streaming JSON:
The parser pairs active and terminal updates by 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.

Junie CLI

Add the adapter:
JunieSessionParser reads Junie’s durable session trace, ~/.junie/sessions/<sessionId>/events.jsonl, from a file or a BufferedReader:
Junie re-emits the same 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.
Junie prices every LLM call, and the per-call costs reconcile to the session total, so the capture carries a real cost. It reports no thinking-token count, so the capture has no thinking-token field; thinking text is captured when the trace contains it.

Cost provenance

Neither Codex nor Antigravity reports monetary cost in these streams. Their cost records are zero-valued and explicitly marked costAvailable=false with an unreported source, so a downstream reader can distinguish “this run cost nothing” from “this CLI never said.” 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.

Portable trace modes

TraceContentMode controls content bodies on modeled trace lines: TraceRawMode is Claude-only and orthogonal:
All trace modes require a data-handling decision. The capture record and journal events can contain the caller-supplied prompt text. Tool inputs are present on portable tool_use lines even in LENGTHS mode. TRUNCATED and FULL portable traces can include assistant text, file contents, tool results, and command output. TraceRawMode.FULL adds the complete available vendor message and can include fields omitted from the typed model. Treat trace and journal files as sensitive, restrict filesystem access, and keep them out of version control.

Two schemas

Do not conflate the two JSONL formats:
  • Canonical journal streams use @type and currently have schema version 1.
  • Portable capture traces use type, ts, and seq and currently have schema version 2.
Both formats have their own header and evolution contract.