Agent skill

Langfuse Data Handling

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Manage Langfuse data export, retention, and compliance requirements.

MITAuto-check passedAI & LLM Engineering

Install Langfuse Data Handling

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill langfuse-data-handling -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace langfuse-data-handling --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/langfuse-data-handling .claude/skills/langfuse-data-handling && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
langfuse-data-handling
GitHub stars
2.8k
Token cost
~2k tokens
SKILL.md length
310 words
Files
2 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Manage Langfuse data export, retention, and compliance requirements.

  • Works in 5 steps: Export Trace Data via API → Export Scores → Data Retention Configuration → …
  • Exporting trace data
  • SKILL.md covers Overview, Prerequisites, Instructions and Data Categories and Retention, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Langfuse Data Handling is an agent skill from jeremylongshore/tons-of-skills-marketplace. Manage Langfuse data export, retention, and compliance requirements. Use when exporting trace data, configuring retention policies, or implementing data compliance for LLM observability. Trigger with phrases like "langfuse data export", "langfuse retention", "langfuse GDPR", "langfuse compliance", "export langfuse traces".

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/implementation.md`). Compatibility notes: Designed for Claude Code

It sits in AI & LLM Engineering, covering LLM observability and Privacy and GDPR. It works with Langfuse. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Exporting trace data
  • Configuring retention policies
  • Implementing data compliance for LLM observability
  • With phrases like langfuse data export

Example prompts

  • “langfuse data export”
  • “langfuse retention”
  • “langfuse GDPR”
  • “/langfuse-data-handling”

Requirements

  • Docker
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Export Trace Data via API
  2. Export Scores
  3. Data Retention Configuration
  4. GDPR Data Subject Requests
  5. Data Anonymization for Analytics

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript and yaml).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • langfuse.com
    • api.reference.langfuse.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Langfuse Data Handling loads about 2k tokens when it runs, and up to ~3k if it reads all its reference files. Until then it costs about 87 tokens; SKILL.md has 310 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~87
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 310 words, ~1,972 tokens.

Download SKILL.mdSave it as .claude/skills/langfuse-data-handling/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
langfuse-data-handling
description
Manage Langfuse data export, retention, and compliance requirements. Use when exporting trace data, configuring retention policies, or implementing data compliance for LLM observability. Trigger with phrases like "langfuse data export", "langfuse retention", "langfuse GDPR", "langfuse compliance", "export langfuse traces".
allowed-tools
Read, Write, Edit
compatibility
Designed for Claude Code
version
1.17.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, langfuse, observability, llm, compliance

Langfuse Data Handling

Overview

Manage the Langfuse data lifecycle: export traces and scores via the API, configure retention policies, handle GDPR data subject requests, anonymize data for analytics, and maintain audit trails.

Prerequisites

  • @langfuse/client installed
  • Langfuse API keys with appropriate permissions
  • Understanding of your compliance requirements (GDPR, SOC2, HIPAA)

Instructions

Step 1: Export Trace Data via API
typescript
import { LangfuseClient } from "@langfuse/client";
import { writeFileSync } from "fs";

const langfuse = new LangfuseClient();

async function exportTraces(options: {
  fromDate: string;
  toDate: string;
  outputFile: string;
  includeObservations?: boolean;
}) {
  const allTraces: any[] = [];
  let page = 1;
  let hasMore = true;

  while (hasMore) {
    const result = await langfuse.api.traces.list({
      fromTimestamp: options.fromDate,
      toTimestamp: options.toDate,
      limit: 100,
      page,
    });

    for (const trace of result.data) {
      const exportItem: any = {
        id: trace.id,
        name: trace.name,
        timestamp: trace.timestamp,
        userId: trace.userId,
        sessionId: trace.sessionId,
        metadata: trace.metadata,
        tags: trace.tags,
      };

      if (options.includeObservations) {
        const observations = await langfuse.api.observations.list({
          traceId: trace.id,
        });
        exportItem.observations = observations.data;
      }

      allTraces.push(exportItem);
    }

    hasMore = result.data.length === 100;
    page++;

    // Rate limit respect
    await new Promise((r) => setTimeout(r, 200));
  }

  writeFileSync(options.outputFile, JSON.stringify(allTraces, null, 2));
  console.log(`Exported ${allTraces.length} traces to ${options.outputFile}`);
}

// Usage
await exportTraces({
  fromDate: "2025-01-01T00:00:00Z",
  toDate: "2025-01-31T23:59:59Z",
  outputFile: "traces-january.json",
  includeObservations: true,
});
Step 2: Export Scores
typescript
async function exportScores(fromDate: string, outputFile: string) {
  const scores: any[] = [];
  let page = 1;
  let hasMore = true;

  while (hasMore) {
    const result = await langfuse.api.scores.list({
      fromTimestamp: fromDate,
      limit: 100,
      page,
    });

    scores.push(...result.data);
    hasMore = result.data.length === 100;
    page++;
    await new Promise((r) => setTimeout(r, 200));
  }

  writeFileSync(outputFile, JSON.stringify(scores, null, 2));
  console.log(`Exported ${scores.length} scores to ${outputFile}`);
}
Step 3: Data Retention Configuration

Self-hosted: Set retention via environment variable:

yaml
# docker-compose.yml
services:
  langfuse:
    environment:
      - LANGFUSE_RETENTION_DAYS=90

Cloud: Programmatic cleanup of old data:

typescript
async function enforceRetention(maxAgeDays: number) {
  const cutoff = new Date(Date.now() - maxAgeDays * 86400000).toISOString();

  const oldTraces = await langfuse.api.traces.list({
    toTimestamp: cutoff,
    limit: 100,
  });

  console.log(`Found ${oldTraces.data.length} traces older than ${maxAgeDays} days`);

  for (const trace of oldTraces.data) {
    await langfuse.api.traces.delete(trace.id);
    await new Promise((r) => setTimeout(r, 100)); // Rate limit
  }
}

// Run as cron job
await enforceRetention(90);
Step 4: GDPR Data Subject Requests
typescript
// Handle "Right to Access" -- export all data for a user
async function handleAccessRequest(userId: string) {
  const traces = await langfuse.api.traces.list({
    userId,
    limit: 1000,
  });

  const userData = {
    userId,
    exportDate: new Date().toISOString(),
    traceCount: traces.data.length,
    traces: traces.data.map((t) => ({
      id: t.id,
      name: t.name,
      timestamp: t.timestamp,
      input: t.input,
      output: t.output,
      metadata: t.metadata,
    })),
  };

  writeFileSync(`gdpr-export-${userId}.json`, JSON.stringify(userData, null, 2));
  return userData;
}

// Handle "Right to Erasure" -- delete all data for a user
async function handleDeletionRequest(userId: string) {
  const traces = await langfuse.api.traces.list({
    userId,
    limit: 1000,
  });

  let deleted = 0;
  for (const trace of traces.data) {
    await langfuse.api.traces.delete(trace.id);
    deleted++;
    await new Promise((r) => setTimeout(r, 100));
  }

  console.log(`Deleted ${deleted} traces for user ${userId}`);
  return { userId, tracesDeleted: deleted };
}
Step 5: Data Anonymization for Analytics
typescript
import crypto from "crypto";

function anonymizeTrace(trace: any): any {
  return {
    ...trace,
    userId: trace.userId ? crypto.createHash("sha256").update(trace.userId).digest("hex").slice(0, 16) : null,
    sessionId: trace.sessionId ? crypto.createHash("sha256").update(trace.sessionId).digest("hex").slice(0, 16) : null,
    input: "[REDACTED]",
    output: "[REDACTED]",
    metadata: {
      model: trace.metadata?.model,
      // Keep operational fields, remove PII
    },
  };
}

async function exportAnonymized(fromDate: string, outputFile: string) {
  const traces = await langfuse.api.traces.list({
    fromTimestamp: fromDate,
    limit: 1000,
  });

  const anonymized = traces.data.map(anonymizeTrace);
  writeFileSync(outputFile, JSON.stringify(anonymized, null, 2));
}

Data Categories and Retention

CategoryContains PII?Default RetentionCompliance Note
Traces (inputs/outputs)Likely90 daysScrub PII before tracing
Generations (LLM I/O)Likely90 daysMay contain user data
ScoresRarely1 yearTypically safe to retain
SessionsUser ID linked90 daysLink to user data requests
PromptsNoIndefiniteTemplate data only
DatasetsMaybePer use caseReview test data for PII

Error Handling

IssueCauseSolution
Export timeoutToo many tracesReduce date range, use pagination
Missing user dataDifferent userId formatVerify exact userId used in traces
Deletion not immediateAsync processingAllow time for propagation
Rate limited during exportToo many API callsAdd 200ms delay between pages

Output

Produce either a redacted, access-controlled export with its date range and trace count, or a deletion receipt containing only the request identifier, affected-user identifier, and deleted-record count. Never place raw prompts, outputs, or API keys in the completion report.

Examples

For a subject-access request, export one user's records to an encrypted controlled location, verify the trace count against the dashboard, and record the export date and retention deadline. For an erasure request, use the exact trace user ID, wait for the documented propagation period, then query again to confirm no matching traces remain.

Resources

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/.curated/langfuse-data-handling of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/implementation.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Langfuse Data Handling next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Langfuse Data Handling compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Langfuse Data Handling this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2kAutomated safety check: PassMIT
Langfuse Codebase Navigatorlangfuse/langfuse36k—~1.4kAutomated safety check: PassCustom licence
Langfuse Integration Pagelangfuse/langfuse-docs246—~3.7kAutomated safety check: PassMIT
Langfuselangfuse/skills301—~2.1kAutomated safety check: NotesMIT
Add Yourself To Team Langfuselangfuse/langfuse-docs246—~548Automated safety check: PassMIT
Weekly Production Reviewlangfuse/langfuse36k—~4.1kAutomated safety check: PassCustom licence

Similar skills

  • Navigate Langfuse repositories, code areas, and agent skills.

    36k GitHub stars~1.4k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Langfuse Integration Page

    langfuse/langfuse-docs

    Create a new Langfuse integration page in the langfuse-docs repo.

    246 GitHub stars~3.7k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Langfuse

    langfuse/skills

    Interact with Langfuse and access its documentation: tracing, monitoring, creating datasets, running experiments, and evaluating AI applications.

    301 GitHub stars~2.1k tokensUpdated 10 days ago
    AI & LLM EngineeringAuto-check: notes
  • Add Yourself To Team Langfuse

    langfuse/langfuse-docs

    Add a new team member to Langfuse's canonical team data and shared team table.

    246 GitHub stars~548 tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Weekly Production Review

    langfuse/langfuse

    Prepare Langfuse weekly production reviews covering failures, fixes, open issues, and tracking gaps.

    36k GitHub stars~4.1k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Agent Setup Maintenance

    langfuse/langfuse

    Shared workflow for editing Langfuse's repo-owned agent setup under .agents/.

    36k GitHub stars~799 tokensUpdated today
    AI & LLM EngineeringAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Questions about Langfuse Data Handling

What does Langfuse Data Handling do?

Manage Langfuse data export, retention, and compliance requirements. Langfuse Data Handling is an agent skill from jeremylongshore/tons-of-skills-marketplace. Manage Langfuse data export, retention, and compliance requirements.

When should I use Langfuse Data Handling?

Langfuse Data Handling fits situations like: exporting trace data; configuring retention policies; implementing data compliance for LLM observability; with phrases like langfuse data export.

How do I install Langfuse Data Handling in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill langfuse-data-handling -a claude-code`. Or copy the skill folder (skills/.curated/langfuse-data-handling in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/langfuse-data-handling in your project. Claude Code loads it when a task matches its description.

How do I install Langfuse Data Handling in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill langfuse-data-handling -a codex`. Or copy the skill folder (skills/.curated/langfuse-data-handling in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/langfuse-data-handling in your project. Codex loads it when a task matches its description.

Can I use Langfuse Data Handling in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill langfuse-data-handling -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/langfuse-data-handling, .gemini/skills/langfuse-data-handling, .github/skills/langfuse-data-handling and .opencode/skills/langfuse-data-handling in your project.

What does Langfuse Data Handling need to run?

SKILL.md names no scripts, command-line tools or credentials: Langfuse Data Handling is instructions for the agent only. Our summary lists: Docker. Its frontmatter pre-approves these tools: Read, Write, Edit. Compatibility (from SKILL.md): Designed for Claude Code.

Does Langfuse Data Handling access the network?

SKILL.md names 2 domains. As links in the text: langfuse.com and api.reference.langfuse.com. This is read from the text; nothing was executed.

Is Langfuse Data Handling safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Langfuse Data Handling use?

Langfuse Data Handling is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Langfuse Data Handling use?

About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.1k tokens, read only when the agent opens those files.

What are the alternatives to Langfuse Data Handling?

Skills that share tags, products or a category with Langfuse Data Handling: Langfuse Codebase Navigator (langfuse/langfuse, 36k stars), Langfuse Integration Page (langfuse/langfuse-docs, 246 stars), Langfuse (langfuse/skills, 301 stars) and Add Yourself To Team Langfuse (langfuse/langfuse-docs, 246 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Langfuse Data Handling?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.