Musterby Elitery
Integrations

Claude Code (CLI)

Trace Anthropic's Claude Code CLI in Muster via the Stop hook + Python forwarder script.

Claude Code is Anthropic's agentic terminal-based coding assistant. The Muster (langfuse) integration is implemented as a Claude Code Stop hook that forwards session data to your Muster project after each turn.

Setup

1. Install the SDK

pip install langfuse

2. Create the hook script

Save the upstream Python script (see upstream docs for the latest version) to:

~/.claude/hooks/langfuse_hook.py

3. Register the hook globally

Add to ~/.claude/settings.json:

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "python3 ~/.claude/hooks/langfuse_hook.py"
          }
        ]
      }
    ]
  }
}

4. Enable per-project tracing

In each repository where you want tracing, add .claude/settings.local.json:

{
  "env": {
    "TRACE_TO_LANGFUSE": "true",
    "LANGFUSE_PUBLIC_KEY": "pk-lf-...",
    "LANGFUSE_SECRET_KEY": "sk-lf-...",
    "LANGFUSE_BASE_URL": "https://app.getmuster.io"
  }
}

What gets traced

  • User inputs and Claude responses
  • Tool invocations (file edits, bash commands)
  • Tool inputs and outputs
  • Session data and timing

Sessions are grouped by Claude Code session id in the Muster UI.

See also