Skip to main content
Understand the JSONL log files Libretto captures during every session.
Libretto automatically records network requests and browser actions to JSONL log files during every session. Your agent reads these files directly to reverse-engineer APIs, reconstruct workflows from user behavior, and debug failures.

Log file locations

.libretto/sessions/<session>/
  logs.jsonl       # CLI and system events
  network.jsonl    # HTTP requests and responses
  actions.jsonl    # User and agent browser actions

network.jsonl

One JSON object per line, one entry per HTTP request/response captured while the session was open.

Key fields

FieldDescription
tsISO timestamp of the request
methodHTTP method (GET, POST, PUT, etc.)
urlFull request URL
statusHTTP response status code
contentTypeResponse content type
responseBodyResponse body string (may be null)
postDataRequest body for POST/PUT requests
pageIdPlaywright page ID that produced the entry

Querying examples

# All POST requests
jq 'select(.method == "POST")' .libretto/sessions/<session>/network.jsonl

# Find requests to a specific endpoint
jq 'select(.url | contains("/api/"))' .libretto/sessions/<session>/network.jsonl

# View JSON API responses
jq 'select(.contentType | contains("application/json")) | .responseBody' \
  .libretto/sessions/<session>/network.jsonl

# Count requests by HTTP method
jq -r '.method' .libretto/sessions/<session>/network.jsonl | sort | uniq -c

actions.jsonl

One JSON object per line, one entry per browser interaction. Libretto records both actions you perform manually in the browser (source: "user") and actions the agent performs programmatically (source: "agent").

Key fields

FieldDescription
tsISO timestamp
sourceuser (manual DOM event) or agent (Playwright call)
actionAction name: click, dblclick, fill, goto, reload, etc.
selectorLocator used by the agent
bestSemanticSelectorCanonical selector from the user DOM event
nearbyTextVisible text near the event target
coordinates{x, y} for pointer events
valueTyped, selected, or submitted value
urlNavigation target for goto-style actions
durationElapsed time in milliseconds (agent entries)
successtrue if the action completed, false on failure
errorError message when the action failed
Agent entries describe what Playwright tried to do (selector, duration). User entries describe what DOM element was actually interacted with (bestSemanticSelector, nearbyText, coordinates).

Querying examples

# Last 20 actions
tail -n 20 .libretto/sessions/<session>/actions.jsonl | jq .

# Show only user-initiated actions
jq 'select(.source == "user")' .libretto/sessions/<session>/actions.jsonl

# Find all failed actions
jq 'select(.success == false)' .libretto/sessions/<session>/actions.jsonl

# Extract selector and action for agent entries
jq 'select(.source == "agent") | {action: .action, selector: .selector}' \
  .libretto/sessions/<session>/actions.jsonl

logs.jsonl

Structured CLI and system log. Contains debug output from Libretto itself, including command execution, errors, and internal events.
# View the last 20 log entries
tail -n 20 .libretto/sessions/<session>/logs.jsonl | jq .