Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

buttercup-langfuse

Skill by trailofbits

Explains how the Buttercup repo wires Langfuse tracing into LangChain and LangGraph code. Covers the get_langfuse_callbacks helper, RunnableConfig tags and metadata, env and Helm settings, and missing-trace debugging. Aimed at developers working in that repo.

  • Score 73
  • 1.8k stars
  • AGPL-3.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install buttercup-langfuse

Built from the published package, never by AI.

git clone --depth 1 https://github.com/trailofbits/buttercup /tmp/buttercup && mkdir -p ~/.claude/skills && cp -r /tmp/buttercup/.claude/skills/buttercup-langfuse ~/.claude/skills/buttercup-langfuse

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install buttercup-langfuse in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill documents how the Buttercup repository integrates Langfuse. It tells the assistant to use one helper, get_langfuse_callbacks() in common/src/buttercup/common/llm.py, rather than creating CallbackHandler objects or reading the environment variables directly. The helper returns an empty list when Langfuse is disabled, misconfigured, or unreachable, so tracing is optional at runtime.

The skill shows how to attach the callbacks through RunnableConfig on compiled LangChain or LangGraph workflows. It describes tag and metadata conventions, the Langfuse environment variables, and the Helm values and templates that inject them into Kubernetes pods. It also gives a step-by-step checklist for missing traces. The skill is for developers working in this repo. Platform-level Langfuse topics such as the CLI, prompt migration, and SDK upgrades are handled by a separate langfuse skill.

Written from the project's SKILL.md and checked against it.

What it can do

  • Add tracing to a new entry pointSteps for attaching Langfuse callbacks to a new LangChain or LangGraph workflow in this repo.
  • Attach tags and metadataConventions for workflow tags, identifier tags, and structured metadata in RunnableConfig.
  • Troubleshoot missing tracesA top-to-bottom checklist for runs that do not appear in Langfuse, from host setup to cache staleness.
  • Configure Helm and env valuesGuidance on the global.langfuse Helm values, the langfuse secret template, and the common env helper.
  • Avoid parallel integrationsRules against direct CallbackHandler use, custom env reads, and separate langfuse dependency pins.

What you need

  • Langfuse host URL and public and secret API keys
  • Python with the langfuse package via the common[full] extra
  • Kubernetes with Helm values for cluster deployments

Try asking

  • Add Langfuse tracing to my new LangGraph entry point in this repo
  • Why are no traces showing in Langfuse for this Buttercup component?
  • Attach task_id and challenge tags to my existing chain's RunnableConfig

Good to know

  • Tracing is optional and silently disabled when Langfuse is not configured or reachable.
  • Configuration is cached per process, so env changes need a process restart.
  • Only LangChain and LangGraph runnables trace. Direct HTTP calls to LLM APIs do not.
  • Scoped to the Buttercup repo. Platform-level Langfuse tasks belong to the langfuse skill.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .claude/skills/buttercup-langfuse/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to buttercup-langfuse

All alternatives →

Compare with agent-reproduce-align, google_contacts or m06-error-handling

buttercup-langfuse: common questions

Will the app fail if Langfuse is down?

No. The source says tracing is optional at runtime. If env vars are unset or the host is unreachable, callbacks resolve to an empty list and code paths are unaffected.

How should code get Langfuse callbacks in this repo?

Call get_langfuse_callbacks() from buttercup.common.llm. The source says not to instantiate CallbackHandler directly or read the Langfuse env vars yourself.

Which tasks should use the langfuse skill instead?

Platform-level work such as the CLI, general instrumentation patterns, prompt migration, and SDK upgrades. This skill only covers Buttercup-local conventions.

How do I install buttercup-langfuse?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is buttercup-langfuse free?

The code is published under the AGPL-3.0 licence. The service it connects to may have its own pricing.

Is buttercup-langfuse safe to use?

It scores 73 of 100. Grades: maintenance B, licence C, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to buttercup-langfuse?

Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.

buttercup-langfuse Install

Add to stack

Loading.