Skip to main content
Claude Code exports OpenTelemetry traces natively. Tracelane accepts OTLP directly, so recording a session is exporter configuration — one command sets it up, no Tracelane SDK required.

What you get

Chain scope. Recorded sessions are full-fidelity in your trace store and queryable like any other trace, the same as traces from any OTel exporter or self-host instrumentation. They are not yet in the tamper-evident hash chain — chaining the OTLP/SDK path is on the roadmap. See Audit Ledger for what is chained today. Proxy mode is the other half and does chain — a call routed through the gateway is a ledger row; a span exported over OTLP is not. The two are separate paths, so which one you set up decides what is chained.

Setup

The key needs the ingest scope. Mint one in Settings → API keys. The command validates the key against the gateway, merges the env block below into ~/.claude/settings.json (or ./.claude/settings.json with --project), and never overwrites a value already set there. Options:

Setting it up by hand

If you’d rather paste the env block yourself — into settings.json’s env object, a shell profile, or a CI job — this is the equivalent of what the command above writes:
Start a new Claude Code session after either path — it picks up the env on launch, not mid-session.

Proxy mode — every Claude Code call in the ledger

The setup above records what Claude Code did: its session tree, over OTLP. Proxy mode records what it asked the model. Point ANTHROPIC_BASE_URL at the gateway and every API call the session makes becomes a gateway span — tokens, cost, and a row in the tamper-evident hash chain — while the response your session receives is Anthropic’s, relayed unchanged.
Three things, in this order:
  1. Store your own Anthropic key in Settings → LLM providers. The gateway holds no Anthropic credential of its own — it uses yours, envelope-encrypted per workspace, at 0% markup. Proxied calls are refused until one is there.
  2. Run the command. It adds two variables to the same env block as the OTel ones:
  3. Start a new session — Claude Code reads the env on launch.
The key needs the chat scope for this, on top of the ingest scope the OTel export needs. --proxy probes for it and refuses to write the file if the key does not carry it, rather than leaving you with a session that fails on its first request.

What proxy mode does and does not change

What a trace looks like

What is not captured

Prompt and tool content are not captured by default. Anthropic gates the message bodies behind its own flags — OTEL_LOG_USER_PROMPTS and OTEL_LOG_TOOL_CONTENT — and tlane init claude-code does not set either. Without them, Claude Code sends user_prompt="<REDACTED>". Claude Code also attaches your account email and ids to each span (user.email, user.id, organization.id). Tracelane’s decoder maps only the token, model and tool attributes it knows about and drops everything else — so those identity fields are never stored.

Span volume and the Free plan

This path is metered in spans, not the gateway’s trace counter — see pricing for the full explanation. The Free plan’s span limit is 10,000 spans/mo, and one Claude Code interaction is several spans (a root plus one per tool call and LLM request), so a busy day can use a meaningful share of it. Run a session against a free account and check the span count on the trace before you commit to a plan.

What you see

Recorded sessions show up on /sessions — one row per Claude Code session, tagged claude-code, with each interaction as a turn. Opening a turn shows its trace: the LLM requests and tool calls nested under the interaction.