langfuse
Skill2 starsChanged 8 months agoMITView on GitHub
Query, analyze, and score Claude Code session traces in LangFuse. Use this skill whenever you need to check session costs, token usage, tool execution patterns, or agent performance in LangFuse. Also use when creating scores, investigating trace data, comparing runs, or when the user mentions LangFuse, observability, telemetry, traces, session costs, or wants to understand what happened in a previous Claude Code session. This skill covers both reading traces and writing scores/annotations back to LangFuse.
- Reads credentials
10 other projects use a version of this.
Adopted by
Most recently taken up by
- LunarCommand/claude-skillstheir own version, first seen Sep 4, 2026
- KonghaYao/peritheir own version, first seen Aug 14, 2026
- Bbar0n234/learnflow-aitheir own version, first seen Aug 11, 2026
- HybridAIOne/hybridclawtheir own version, first seen May 12, 2026
- phuquocchamp/claude-code-101their own version, first seen Apr 13, 2026
- avivsinai/langfuse-mcptheir own version, first seen Mar 27, 2026
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 10
- langfuse/skills★ 295same name
- KonghaYao/peri★ 221same name
- HybridAIOne/hybridclaw★ 157same name
- avivsinai/langfuse-mcp★ 113same name
- Bbar0n234/learnflow-ai★ 35same name
- xfstudio/skills★ 9same name
- ajbmachon/ajbm-skills★ 7same name
- ai4brands-design/claude-skills★ 2same name
- LunarCommand/claude-skills★ 1same name
- phuquocchamp/claude-code-101★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
When the telemetry bridge is running, it catches those signals and forwards them to your LangFuse instance.
- Distinctive: line 113
Every trace from Claude Code includes these OTEL signals:
- Very specific: line 123
Subagent correlation: All subagent API calls and tool executions share the parent trace's prompt.id.
- Distinctive: line 127
Create score configs to define your scoring schema, then attach scores to traces:
- Distinctive: line 168
If the CLI doesn't surface what you're looking for:
“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
LangFuse Observability
Access and analyze Claude Code session telemetry stored in LangFuse. This skill covers querying traces, analyzing costs and performance, and writing scores back to LangFuse.
How the Setup Works
Claude Code emits OpenTelemetry (OTEL) signals — metrics, events, and distributed traces — on every API call and tool execution, including subagent calls. These signals are configured to export to localhost:4318.
When the telemetry bridge is running, it catches those signals and forwards them to your LangFuse instance. When the bridge is off, exports silently fail with zero impact.
Claude Code (OTEL always active)
→ localhost:4318 (OTLP HTTP/JSON)
→ lainra/claude-code-telemetry bridge (Node.js)
→ cloud.langfuse.com (LangFuse Cloud)Bridge location: ~/.claude/telemetry/claude-code-telemetry/
Bridge control: record-start / record-stop (shell functions)
Credentials: LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, LANGFUSE_HOST set in your shell profile.
Primary Tool: LangFuse CLI
The langfuse-cli is installed globally and is the primary way to interact with LangFuse. Auth is handled via environment variables already configured in the shell.
langfuse api <resource> <action> [options]Discovery pattern — when you're unsure what's available:
langfuse api __schema # List all resources
langfuse api <resource> --help # List actions for a resource
langfuse api <resource> <action> --help # Show flags for an action
langfuse api <resource> <action> --curl # Preview the curl commandKey Resources
| Resource | What it holds |
traces | One per user prompt. Contains cost, tokens, metadata. |
observations | Individual steps within a trace (API calls, tool executions) |
sessions | Groups of traces from one Claude Code CLI session |
scores | Quality ratings attached to traces or observations |
score-configs | Schema definitions for score types |
metrics | Aggregated data (costs, tokens, latency) across dimensions |
prompts | Managed prompts (not relevant to OTEL traces) |
datasets | Evaluation datasets |
Common Queries
List recent traces:
langfuse api traces list --limit 10Get a specific trace by ID:
langfuse api traces get <trace-id>List traces for a specific session:
langfuse api traces list --session-id <session-id>List observations with cost/token data:
langfuse api observations list --fields core,usage,model --limit 20Get aggregated metrics (cost by model):
langfuse api metrics list --view observations --measures totalCost --dimensions providedModelName --from-timestamp <ISO-date>List sessions:
langfuse api sessions list --limit 5For complex queries, read references/cli-patterns.md for advanced filtering, pagination, and aggregation examples.
Data Model
Understanding how LangFuse structures data helps you query effectively.
Session → contains multiple Traces → each trace contains multiple Observations
- Session (
session.id): One Claude Code CLI session. All prompts within that session share the same session ID. - Trace (
prompt.id): One user prompt and everything it triggered — API calls, tool executions, subagent work. The tracenamefield showsconversation-N(the Nth prompt in the session). - Observation: A single step within a trace. Types:
GENERATION— an API call to Claude (has model, tokens, cost)SPAN— a tool execution or logical grouping (has duration)EVENT— a discrete event (tool_result, user_prompt, etc.)
Scores can be attached to traces or observations. They have a name, value, dataType (NUMERIC, BOOLEAN, CATEGORICAL), and source (API, ANNOTATION, EVAL).
What's Captured in Each Trace
Every trace from Claude Code includes these OTEL signals:
| Signal | Key Fields |
api_request | model, cost_usd, input/output/cache tokens, duration_ms, speed |
tool_result | tool_name, success, duration_ms, tool_parameters, tool_input |
user_prompt | prompt text, prompt_length |
api_error | model, error, status_code, duration_ms |
tool_decision | tool_name, decision (accept/reject), source |
Subagent correlation: All subagent API calls and tool executions share the parent trace's prompt.id. A multi-agent command with 12 subagents produces one trace with all their events correlated.
Writing Scores
Create score configs to define your scoring schema, then attach scores to traces:
Create a score config:
langfuse api score-configs create --name "response-quality" --data-type NUMERIC --min-value 1 --max-value 5 --description "Quality of agent response"Score a trace via the ingestion API:
langfuse api ingestions create --body '{
"batch": [{
"id": "unique-event-id",
"type": "score-create",
"timestamp": "2026-04-03T00:00:00Z",
"body": {
"traceId": "<trace-id>",
"name": "response-quality",
"value": 4,
"dataType": "NUMERIC",
"source": "API"
}
}]
}'Documentation & References
| Need | Where to look |
| CLI command reference | langfuse api <resource> <action> --help |
| Full API reference | https://api.reference.langfuse.com |
| Data model | https://langfuse.com/docs/observability/data-model |
| Scores & evaluation | https://langfuse.com/docs/evaluation/overview |
| Metrics API | https://langfuse.com/docs/metrics/features/metrics-api |
| OTEL signals from Claude Code | https://code.claude.com/docs/en/monitoring-usage |
| LangFuse docs MCP | Available as mcp__langfuse-docs__searchLangfuseDocs in session |
| Advanced CLI patterns | Read references/cli-patterns.md |
| Bridge setup details | Read references/bridge-architecture.md |
When You Can't Find What You Need
If the CLI doesn't surface what you're looking for:
- Use the LangFuse docs MCP —
mcp__langfuse-docs__searchLangfuseDocsis available for semantic search across all LangFuse documentation. - Check the API reference —
langfuse api <resource> <action> --curlpreviews the raw HTTP request, which you can adapt. - Fetch a docs page directly —
mcp__langfuse-docs__getLangfuseDocsPagewith a path like/docs/evaluation/overview.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

