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.
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-langfuseRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/trailofbits/buttercup /tmp/buttercup && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/buttercup/.claude/skills/buttercup-langfuse ~/.gemini/antigravity-cli/skills/buttercup-langfuseAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
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
ANo 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 →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
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.
