larik v0.3.0

Guide

Debug mode and traces

Debug mode records what the harness does in a session, so you can review it afterwards or watch it live: each prompt, every model request as it was sent (system prompt, tools, messages, parameters), each response with its timing, token use and cost, the raw HTTP exchange with the provider, tool calls with their input and output, permission answers and how long they waited, hooks, notices and compactions. Subagents are recorded in their own lanes.

Turn it on with larik --debug (also larik -p --debug and larik serve --debug), LARIK_DEBUG=1, "debug": true in personal settings, or /debug on in a session (/debug off stops it, /debug shows where it's recording). While it records, the footer shows ● rec.

Review a trace with /trace in the TUI, or larik trace from a shell, which opens the latest traced session in this directory (larik trace <session-id> for another). It serves a page on 127.0.0.1 behind a random token and opens your browser:

  • Timeline: one lane per agent. Each request is split into waiting for the first output and generating; tool calls, permission waits and hooks sit beside them, with prompts marked. Long idle stretches are collapsed. Scroll to zoom, drag to pan, shift+drag to filter the list to a time range, double-click to reset. It follows a live session as it grows.
  • List: every record in order, grouped by prompt, filterable by kind, agent and text.
  • Inspector: for a request, its overview (model, timing, tokens per second, usage, cost), the prompt as sent with the system prompt and tool list diffed against the previous request and new messages marked, the response, and the raw HTTP request and streamed response. For a tool call, its input, output and permission answer.

larik trace --html trace.html writes one self-contained page instead, to keep or share.

Traces are stored next to the session, in <session>.trace/ under the data directory (owner-only), and deleted after 14 days (debug_retention_days; negative keeps them). Only new messages are written with each request, so a trace grows with the conversation rather than with its square; the raw HTTP bodies, though, hold each full request. API keys and other credential headers are redacted; prompts, file contents and tool output are not, so treat a trace like the session itself.

Generated from README.md · section “Debug mode and traces”. Edit that file to change this page.