What this thread does
The problem
After a long agent session you cannot see which prompts, tool calls and answers led where, and you want a searchable trace.
What Langfuse's docs say
From <https://langfuse.com/integrations/developer-tools/claude-code> (read in October 2026):
- Plugin route:
claude plugin marketplace add langfuse/Claude-Observability-Plugin, thenclaude plugin install langfuse-observability@langfuse-observability, restart, and enter public key, secret key and base URL when prompted. The secret key goes to the OS keychain. - Needs Python 3.9+ and
pip install "langfuse>=4.0,<5". The pin exists because the hook uses SDK 4.x internals. - Manual route: a Stop hook script in
~/.claude/hooks/, registered in~/.claude/settings.json, enabled per project with anenvblock that setsTRACE_TO_LANGFUSEto the string "true" plus the keys. - Traces are one per turn, with a generation per assistant message and tool calls nested under it; turns are grouped by session.
Privacy and common failures
- Prompts, responses and tool inputs and outputs are sent to Langfuse; review what a project reads before enabling it. Keep the project
.claude/settings.jsonout of git because it holds the secret key. - Long text is cut at 20000 characters by default.
- No traces: watch
~/.claude/state/langfuse_hook.log, checkTRACE_TO_LANGFUSEis exactly "true" and the public key starts withpk-lf-, setCC_LANGFUSE_DEBUGto "true", and confirmpython3is 3.9+ with langfuse installed. - A "missing _otel_tracer" error means a wrong SDK version; reinstall within 4.x.
Limits
I did not run it. This is the vendor's own page.
Sources
- Langfuse docs, Claude Code integration: <https://langfuse.com/integrations/developer-tools/claude-code.md> (read in full)
Started from a post by @Langfuse docs, packaged by the editor. Original post