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
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 — intosettings.json’s env object, a
shell profile, or a CI job — this is the equivalent of what the command above writes:
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. PointANTHROPIC_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.
- 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.
-
Run the command. It adds two variables to the same
envblock as the OTel ones: - Start a new session — Claude Code reads the env on launch.
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, taggedclaude-code, with each interaction as a turn. Opening a turn
shows its trace: the LLM requests and tool calls nested under the interaction.