EvalFlow Observability Plugin for Claude Code
This plugin sends Claude Code sessions to
EvalFlow. EvalFlow is
Langfuse-compatible: this integration uses the Langfuse-compatible
observability protocol. It records the user prompts, the agent turns,
the model generations with their tokens and cost, and the tool calls, with no
change to your code.
This fork is maintained as part of EvalFlow. Configuration, environment
variables, and telemetry behavior remain Langfuse-compatible and unchanged.
Upstream Langfuse also documents the original integration on the
Claude Code integration page.
What can this integration trace?
The plugin runs as a Claude Code hook and reads the session transcript on every
turn, so tracing needs no change to the way you work:
- Agent turns: one trace per user prompt, with all turns of a session grouped
under one session ID.
- Model generations: every assistant message with inputs, outputs, cost and
token usage, including cache reads and a cache write split by the lifetime it
was written under, which each carry their own rate.
token usage, including cache-read and reasoning splits.
- Thinking: assistant thinking blocks attach to the generation that produced
them and render as thinking blocks in the trace. Claude Code writes the
thinking text only when
showThinkingSummaries is true in its settings.
- Tool calls: each tool Claude Code invokes, with input and output.
- Subagents: subagent and Workflow-spawned agent transcripts nest under the
turn that started them.
- Skills: traces carry a
skill:<name> tag for every skill a turn invokes.
- Images: pasted images and screenshots from tool results upload as media
(via the Langfuse-compatible observability protocol) and render inside the trace.
Tracing covers the claude CLI and desktop Code mode; regular Claude Desktop
Chat mode runs no Claude Code hooks and is not traced.
Prerequisites
One of:
- uv (recommended) on
PATH. The hook uses
uv run --script and installs the Langfuse SDK (compatibility layer) from the script metadata.
- Python 3.10+ as
python3 with langfuse>=4.7,<5 installed. This is only a
fallback for when uv is not on PATH.
On the first hook run, uv downloads the SDK from PyPI and caches it. An offline
or proxied machine retries that download every turn until the cache is warm, so
pre-warm it from a networked terminal:
echo '{}' | uv run --quiet --script <plugin-root>/hooks/langfuse_hook.py
Without a usable runtime the hook exits without tracing, never blocks or slows
Claude Code, and logs the reason, see Troubleshooting.
Install
claude plugin marketplace add langfuse/Claude-Observability-Plugin
claude plugin install langfuse-observability@langfuse-observability
The marketplace command registers the plugin marketplace and refreshes its local
cache. The install command enables the plugin for your Claude Code user scope.
Restart Claude Code afterwards so the hook configuration is loaded.
Add your EvalFlow (Langfuse-compatible) credentials
Configure the plugin from inside a Claude Code session. This is a Claude Code
slash command, not a shell command:
$ claude
> /plugin configure langfuse-observability@langfuse-observability
Alternatively, pass the values during install:
claude plugin install langfuse-observability@langfuse-observability \
--config LANGFUSE_PUBLIC_KEY=pk-lf-... \
--config LANGFUSE_SECRET_KEY=sk-lf-... \
--config LANGFUSE_BASE_URL=https://cloud.langfuse.com
Only LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY are required; without
LANGFUSE_BASE_URL the plugin uses https://cloud.langfuse.com (EU region).
Get keys from your EvalFlow / Langfuse-compatible project settings → API Keys. The secret key is held
in your OS keychain, not in a file.
Configuration options
Set these through /plugin configure or --config, unless the table says the
value is a per-run environment variable.