Skip to content

Open-source tracing for long-running agents

Trace the run.Explain the outcome.

Kibitz captures model calls, tools, retrievals, cost, latency, and user boundaries—then turns hours of agent work into a trace you can actually investigate. Instrument your own agent, or import Claude Code and Codex sessions.

Live long-run trace · cc_3e91d7Open decision timeline
  • User request1m 10s
  • Mapping the current call graph first — I need to know every egress point before I put a policy in front of them.2.2s
  • Run the type checker630ms
  • Rewrite the import to the new package4.7s
  • Delegate the codemod to a sub-agent1.7s
  • Read the module before touching it1.3s
  • Find every call site of the deprecated helper2.9s
  • Rewrite the import to the new package1.8s
  • Rewrite the import to the new package1.0s
  • 6 request groups · 156 observations · 652.2K · $9.774

Repeated identical call

Called the same tool with the same arguments

Tool and arguments are identical to the earlier call, and nothing wrote to that target in between. Same input, so the result had no reason to differ.

Observed values

Tool
Read
Argument hash
ab896d22= previousTurn 5 · ab896d22
Writes in between
0
Newly secured records
0

Rule · hash(tool, args) == previous call

Rendered from this build’s trace data—not a marketing screenshot.

  • 340 decisions analysed
  • Python SDK + code-agent import + HTTP
  • 6 evidence-backed failure modes found
  • Self-hosted, file-first storage

Built for agent-length traces

A span tree shows what ran. Kibitz helps you understand the run.

As agents move from a handful of calls to hundreds of steps, raw spans stop being an explanation. Kibitz keeps the complete execution tree, then groups it by request, reconstructs the decision path, and places evidence-backed findings on the step that caused them.

The recorded path and the alternative remain connected, so a finding is more than a red badge.
The recorded path and the alternative remain connected, so a finding is more than a red badge.

Kibitz targets the core Langfuse tracing workflow and adds long-run investigation. Native SDKs, OTLP/HTTP JSON, code-agent live import, Langfuse migration, persistent resources, and project-scoped APIs now share one trace model.

Tracing

Hundreds of observations become a route you can scan

One user request governs everything the agent does until the next one. Kibitz uses that boundary to collapse long work into meaningful groups without losing the nested observations, timing, or findings inside.

Rebuilt the service gateway over a full working day across 6 requests

156 observations → 6 request groups

  1. 01

    Request groups

    Collapse a long session at the user-intent boundary while retaining every child observation.

  2. 02

    Decision path

    Read progress as a route; repeated tool sequences visibly return instead of disappearing in a waterfall.

  3. 03

    Context movement

    See cache reads, writes, fresh input, output, and explicit compaction events across the run.

  4. 04

    Evidence & alternative

    A finding includes the observed values, the rule, and the action that would have avoided the waste.

Ingestion

Start with the agent you already run

Use the Python SDK for code you own, import the session logs already produced by Claude Code or Codex, or send the trace schema over HTTP. The ingestion path changes; the investigation experience does not.

  • Ingests from
  • Claude Code
  • Codex
  • OpenTelemetry
  • LangChain
  • Langfuse
  • Python
  • TypeScript
Use the Python SDK for code you own, import the session logs already produced by Claude Code or Codex, or send the trace schema over HTTP. The ingestion path changes; the investigation experience does not.

Custom Python agent

Add request boundaries and tool spans directly in your code. Failed spans are flushed too.

agent.py
# Instrument a custom Python agent
from kibitz_sdk import trace, tool

@tool
def search(query: str):
    return db.search(query)

with trace("monthly-report", agent="reporter") as run:
    with run.request("Summarize Q3 revenue"):
        rows = search("revenue 2026 Q3")
        run.answer(summarize(rows))

Claude Code & Codex

Read local JSONL sessions after the run—no plugin or model call required.

terminal
# Import your most recent Claude Code + Codex sessions
uv run --project agent python -m kibitz_ingest.cli \
  --source all --limit 8

Any runtime

POST a completed Kibitz Run JSON. Token authentication is optional for local use and expected on a network.

POST /api/traces

Keep the trace where the work happened

Kibitz works file-first on a laptop and ships a Docker Compose path with persistent trace storage and optional ingest/read tokens. Detection needs no API key; model-based suggestions are opt-in and use your provider.

  • Local files remain readable without a running collector
  • HTTP failures fall back to a local trace file
  • Prompt recording is off by default in the LangChain callback
  • The app labels truncated runs and estimated cost
Kibitz works file-first on a laptop and ships a Docker Compose path with persistent trace storage and optional ingest/read tokens. Detection needs no API key; model-based suggestions are opt-in and use your provider.

The paths needed to adopt, operate, and improve are connected

  • Capture: async-safe Python, TypeScript, OTLP/HTTP JSON, direct HTTP, Claude Code, Codex, and Langfuse observations_v2
  • Improve: persistent prompt, dataset, evaluator, annotation queue, and automation resource APIs
  • Operate: atomic trace writes, shared-volume stateless replicas, and project-scoped read/ingest/admin tokens
  • Evaluate: inspectable deterministic evidence first, optional BYOK semantic suggestions second, human review when judgment is required

Trace one real run before adding another dashboard

Start with a local code-agent session or wrap one Python agent. The quickstart ends at a visible trace, not at an SDK install.

Read the quickstart