langfuse-agent-cli · MIT · Python 3.10+

Langfuse traces, sized for coding agents

Ask your coding agent about your LLM app in plain English. It answers from your Langfuse data with lf, a command-line tool and agent skill: failing traces with their error messages, a trace as a tree, conversations, cost, latency, prompts and scores.

Install on macOS or Linux
$ curl -fsSL https://tns15june.github.io/langfuse-agent-cli/install.sh | sh

It installs lf with uv or pipx and runs lf setup: your Langfuse keys, the agent skill, and a check. To install it yourself: uv tool install langfuse-agent-cli, then lf setup. Works with Langfuse v4, self-hosted or Cloud.

what the agent seesLangfuse 4.70 · synthetic data · shortened
lf trace get 33579e8e8ec602e878f0744ad53ac1fe --timeline
Trace 33579e8e8ec602e878f0744ad53ac1fe: 3 observations, 1 error
✓ AGENT support-agent-turn
  ✓ GENERATION plan-step (model: gpt-4o-mini)
  ✗ [ERROR] TOOL search_tool_call
      Message: 503 Service Unavailable

lf trace list --limit 100 --output-summary
{
  "summary": true,
  "outputFile": "/tmp/lf-y7qgu_0r.json",
  "bytes": 24322,
  "rows": 36,
  "rowKeys": ["id", "traceId", "name", "level", "latency", …],
  "hint": "The JSON output is larger than 16 KB, so it was …"
}
Try it

Ask in plain English

Start a new session of your coding agent and ask, for example:

More questions, with the commands your agent runs for them: agent examples.

Measured

Smaller output, same answers

Measured on Langfuse 4.70 with synthetic data. Real traces with long prompts and outputs shrink by more.

BeforeWith lf
One trace: every field group vs. the groups lf trace get asks for3 observations
12.9 KB
2.9 KB
−78%
Failing observations: the full rows vs. 7 triage fields with --agent-fields4 rows
3.0 KB
1.05 KB
−66%
A 100-trace listing vs. the summary --output-summary prints36 rows; the full JSON goes to a file
24.3 KB
0.7 KB
−97%
How it works

From a question to a diagnosis

Coding agent

Claude Code, Codex, Cursor…

Asked “why did my app fail?”, it loads the skill on its own.

Skill

SKILL.md

Teaches the commands and the rules: keep output small, read before writing, never ask for keys in chat.

CLI

lf

Reads traces from /api/public/v2/observations, totals for cost, latency and errors from /api/public/v2/metrics, plus prompts, datasets and scores.

Output

Compact JSON, a tree, or a summary file

Sized for a context window, with errors and their messages up front.

Let your agent install it

One line for your coding agent

Prompt

Install langfuse-agent-cli using https://tns15june.github.io/langfuse-agent-cli/AGENTS.md

  1. The agent finds or installs lf, with the one-line installer or with uv or pipx.
  2. It runs lf setup --yes, which installs the skill for that agent and never prompts.
  3. If no keys are configured, it asks you to run lf setup in your own terminal. It never asks for keys in chat.
  4. It reports what lf doctor found and suggests a first question to try.
Verified

Tested the way people will use it

10 / 10plain-English questions answered correctly by fresh Claude Code sessions with only the skill
399unit tests, on Python 3.10, 3.11, 3.12 and 3.13 in CI
13 / 13live tests against the newest Langfuse release in CI, and 4.70 locally
4.30, 4.70Langfuse versions lf metrics and lf doctor ran against; the full live suite on 4.70