AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Langfuse

skill-lunarcommand-claude-skills-langfuse · by LunarCommand

Interact with Langfuse and access its documentation. Use when needing to (1) query or modify Langfuse data programmatically — traces, prompts, scores, sessions, observations, (2) look up Langfuse documentation, concepts, integration guides, or SDK usage, or (3) understand how any Langfuse feature works. Works against self-hosted and cloud Langfuse, on both the legacy v1 REST API (server major <=…

No reviews yet
0 installs
19 views
0.0% view→install

Install

$ agentstack add skill-lunarcommand-claude-skills-langfuse

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-lunarcommand-claude-skills-langfuse)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
20d ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Langfuse? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Langfuse

This skill helps you use Langfuse effectively: debugging traces, inspecting LLM generations and tool calls, reviewing sessions, and managing prompts.

Core Principles

  1. Use the query script for data access: Run langfuse_query.sh for all Langfuse queries. It detects the server's API generation and picks the right endpoints. The script ships in this skill's bin/ directory, which is on the Bash tool's PATH whenever the skill is installed — invoke it by bare name, never by an absolute path.
  2. Documentation First: When implementing SDK integrations, always fetch current docs before writing code (Langfuse updates frequently).

Per-Project Configuration (.agent.env)

Each project should have a .agent.env file in the project root:

LANGFUSE_BASE_URL: http://localhost:3000
LANGFUSE_PUBLIC_KEY: pk-lf-...
LANGFUSE_SECRET_KEY: sk-lf-...
  • LANGFUSE_BASE_URL: base URL of your Langfuse instance — local, EU cloud

(https://cloud.langfuse.com), or US cloud (https://us.cloud.langfuse.com).

  • API keys are in your Langfuse project under Settings > API Keys.

If any value is missing from .agent.env, ask the user to add it before proceeding.

Permissions

The query script is meant to be pre-approved, via this rule:

Bash(langfuse_query.sh:*)

Neither install route installs that rule — it ships in the toolkit's project-files/.claude/settings.json template, which the user merges into a project's .claude/settings.json (or their user settings) themselves. If every call prompts, the rule is absent: that is unfinished setup, not a broken skill, and not a reason to reach for curl. Say so once and carry on.

Run the script directly — never export env vars manually or run curl directly for data access. Both trigger permission prompts. The script reads .agent.env automatically from the project root.

The rule approves the bare command name, matching whatever PATH resolves it to. An invocation prefixed with an inline env var (LANGFUSE_MAX_RECORDS=10000 langfuse_query.sh ...) falls outside it and will prompt — expected, and rare enough not to warrant a broader rule.

Two failures are environment rather than defects: Missing required command: (exit 127) means a dependency is absent — tell the user to install it; and command not found: langfuse_query.sh means the skill's bin/ is not on PATH, so the plugin is disabled or the session predates the install. Neither is a reason to edit the script.

API generations (important)

Langfuse v4 changed the read API surface. The script reads the server version once from /api/public/health and routes accordingly:

| | legacy (server ≤ 3) | v4 (server ≥ 4) | |---|---|---| | Traces | /traces, /traces/{id} | gone (404) — derived from observations | | Observations | /observations, /observations/{id} | /v2/observations (+ structured filter for a single id) | | Sessions | /sessions | gone (404) — derived from observations | | Scores | /scores | /v3/scores | | Prompts | /v2/prompts | /v2/prompts (unchanged) |

Check what you're talking to:

langfuse_query.sh apigen        # → legacy | v4

Override detection with LANGFUSE_API_GEN=legacy|v4 if needed.

Three v4 behaviours worth knowing

  • traces and sessions are derived, not equivalent. v4 exposes no trace

or session read entity, so the script groups observations by traceId / sessionId. Both label their output as derived. A trace's "name" is inferred from its earliest observation.

  • Content requires field groups. /v2/observations returns only core and

basic fields by default — no input, output, usage, or model. The script requests fields=core,basic,time,io,metadata,model,usage,prompt where content matters. A port that forgets this silently returns metadata only.

  • Input/output are always raw strings. parseIoAsJson=true is deprecated

and returns 400. The script decodes JSON-looking strings client-side.

Pagination

v4 pagination is cursor-based (meta.cursor), not page-numbered — passing page=N is silently ignored and returns the same rows. The script walks the cursor transparently, so commands return the complete set rather than one page.

Walks are bounded by LANGFUSE_MAX_RECORDS (default 2000) so a busy project can't trigger an unbounded crawl. When the cap is hit the script says so on stderr and tells you what to raise:

note: stopped at the 2000-record cap after 20 pages; raise LANGFUSE_MAX_RECORDS for more
LANGFUSE_MAX_RECORDS=10000 langfuse_query.sh trace 

1. Querying Langfuse Data

# List recent traces
langfuse_query.sh traces --limit 5
langfuse_query.sh traces --name my-trace-name --limit 10
langfuse_query.sh traces --session-id abc123 --limit 10

# Get a full trace with all observations
langfuse_query.sh trace 

# Show LLM generations and tool calls for a trace (most common debugging task)
langfuse_query.sh generations 

# List observations for a trace, optionally filtered by type
langfuse_query.sh observations  --type GENERATION

# Get a single observation with full detail (raw JSON)
langfuse_query.sh observation 

# Sessions, scores, prompts
langfuse_query.sh sessions --limit 5
langfuse_query.sh scores --trace-id 
langfuse_query.sh prompts

# Which API generation am I on?
langfuse_query.sh apigen

Common Workflows

Check what the LLM actually received and returned:

langfuse_query.sh traces --limit 3        # find the trace
langfuse_query.sh generations   # model, prompt name+version, tokens, input, output

On v4 this also shows the linked prompt (promptName / promptVersion), which is the fastest way to confirm which prompt version produced a given output.

Review a full trace end-to-end:

langfuse_query.sh trace 

Shows trace metadata plus a chronological list of all observations with tool calls and token counts.

Inspect token usage and cost:

langfuse_query.sh generations 

Get raw JSON for one observation (full untruncated input/output):

langfuse_query.sh observation 

Troubleshooting

  • 404s on every command — you are on a v4 server but detection returned

legacy (or vice versa). Check langfuse_query.sh apigen and force with LANGFUSE_API_GEN.

  • Generations show no input/output — the observation genuinely has none, or

you are calling the API directly without fields=...,io.

  • traces shows fewer traces than expected on v4 — the walk stopped at

LANGFUSE_MAX_RECORDS. The script prints a note on stderr when that happens; raise it and re-run.

  • A command is slow on v4 — it is paging. Each page is 100 observations, so

a 2000-record trace costs 20 round trips. Narrow with --type where you can.

2. Langfuse Documentation

Three methods to access Langfuse docs, in order of preference. Always prefer your application's native web fetch and search tools (e.g., WebFetch, WebSearch) over curl when available.

2a. Documentation Index (llms.txt)

curl -s https://langfuse.com/llms.txt

Returns a structured list of every doc page with titles and URLs. Use this to discover the right page for a topic, then fetch that page directly.

2b. Fetch Individual Pages as Markdown

Any page listed in llms.txt can be fetched as markdown by appending .md:

curl -s "https://langfuse.com/docs/observability/overview.md"

2c. Search Documentation

curl -s "https://langfuse.com/api/search-docs?query=How+do+I+trace+LangGraph+agents"

Instance API spec

A self-hosted instance serves its own OpenAPI spec, which is authoritative for that exact version — more reliable than the docs site when endpoints have moved:

curl -s "$LANGFUSE_BASE_URL/generated/api/openapi.yml"

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.