Home
cd ../playbooks
Developer ToolsIntermediate

LangSmith Fetch

Debug LangChain and LangGraph agents by fetching execution traces from LangSmith Studio for error analysis and performance optimization.

10 minutes
By ComposioSource
#langsmith#langchain#langgraph#debugging#traces#agents

Your LangChain agent failed on a customer query and the logs say nothing useful. The trace is in LangSmith but clicking through nested spans in a web UI to find where the tool call went wrong takes forever. You need the trace data in your terminal, not a browser tab.

Who it's for: LangChain developers debugging agent behavior, LangGraph builders optimizing multi-step workflows, AI engineers investigating production failures, teams monitoring LLM application performance, anyone who needs LangSmith trace data without leaving their IDE

Example

"Fetch the traces for yesterday's failed customer support agent runs" → Execution traces pulled from LangSmith showing exactly where each run failed — tool call errors, memory issues, and token usage — analyzed in your terminal with root cause suggestions

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

Or install from your terminal:
npx ccplaybooks add langsmith-fetch
# LangSmith Fetch

Debug LangChain and LangGraph agents by fetching execution traces from LangSmith Studio. Investigate agent behavior, errors, tool calls, memory operations, and performance metrics.

## Installation

```bash
pip install langsmith-fetch
```

## Configuration

Get new playbooks like this one

One email a week with new Claude Code workflows. Free, like everything here.

No spam. Unsubscribe anytime.

README.md

What This Does

Debug LangChain and LangGraph agents by fetching execution traces from LangSmith Studio. Investigate agent behavior, errors, tool calls, memory operations, and performance metrics through terminal commands.


Quick Start

Step 1: Install

pip install langsmith-fetch

Step 2: Configure

export LANGSMITH_API_KEY="your_key"
export LANGSMITH_PROJECT="your_project"

Step 3: Debug

claude

Then say: "Debug my agent's recent activity"


Four Debug Workflows

Workflow Purpose
Quick Debug Last 5 minutes of activity
Deep Dive Analyze specific trace ID
Export Session Save traces for sharing
Error Detection Find and categorize errors

Activation Triggers

Claude activates this skill when you mention:

  • "Debug my agent"
  • "Show recent traces"
  • "Check for errors"
  • "Review agent performance"

Quick Debug Report

Get a summary of recent activity:

  • Success/failure counts
  • Tools used
  • Execution times
  • Token consumption
  • Error summary

Deep Dive Analysis

For specific trace investigation:

  • Complete execution flow
  • Step-by-step breakdown
  • Root cause analysis
  • Suggested fixes

Output Formats

Format Best For
pretty Visual inspection
json Detailed analysis
raw Piping to other commands

Example Prompts

  • "Why is my agent not responding?"
  • "Show traces with errors from the last hour"
  • "Analyze trace abc123 for issues"
  • "Export today's debug session"
  • "What tools is my agent using most?"

Common Issues Detected

  • Unresponsive agents
  • Incorrect tool selection
  • Memory operation failures
  • Performance bottlenecks
  • Token limit issues

Tips

  • Check recent first: Start with quick debug
  • Use trace IDs: Deep dive specific issues
  • Export for team: Share debug sessions
  • Track patterns: Look for recurring errors

$Related Playbooks

Developer Tools

Long-Horizon Agent Prompting

Design the launch prompt for an agent working autonomously for hours or days — a pseudo-formal task brief with an exact success predicate, an enumerated non-counting-outcomes list, adversarial verification, and effort floors, because persistence pressure against a loose spec produces confident non-solutions.

10 minutes
Advanced
Developer Tools

Loopy: Build and Reuse Agent Loops

Mine your codebase and coding history for repeated work, turn it into bounded agent loops, and audit the loops you already have

10 minutes
Intermediate
Developer Tools

LLM Icon Finder

Find and download AI/LLM model brand icons from the lobe-icons library — Claude, GPT, Gemini, and more — as ready-to-use SVG, PNG, or WEBP URLs.

5 minutes
Beginner
Developer Tools

LLM Coding Guardrails

Four behavioral guidelines that reduce the most common Claude coding mistakes: silent assumptions, overcomplication, scope creep, and vague success criteria.

2 minutes
Beginner
Developer Tools

Multi-Stage Prompt Pipeline

A methodology for building Claude-to-Claude prompt pipelines where one stage's output feeds the next — a four-purpose taxonomy (Research/Plan/Do/Refine), per-prompt provenance folders, XML-structured outputs with required metadata tags, a fixed human-scannable SUMMARY.md, dependency-aware layered execution, and per-stage validation before anything chains forward.

10 minutes
Advanced
Developer Tools

Minimalist UI Design Skill: Editorial, Monochrome Interfaces

A frontend design system that enforces warm monochrome, bento grids, and editorial typography — the Notion/Linear look, banned from gradients, heavy shadows, and Inter

5 minutes
Beginner
Developer Tools

Mermaid Tools

Extract Mermaid diagrams from markdown files and render them to high-quality PNG images using bundled scripts — turning text diagrams into shareable visuals.

5 minutes
Beginner
Developer Tools

Minimalist MVP Scoping

Scope a weekend-shippable MVP using the manual → processized → productized progression. Build as little as possible; charge from day one.

5 minutes
Beginner
Developer Tools

MCP Server Hub Manager

Access 1200+ AI Agent tools via Model Context Protocol (MCP)

10 minutes
Advanced
Developer Tools

n8n Workflow Builder

Automate document workflows with n8n - 7800+ workflow templates

10 minutes
Advanced
Developer Tools

MCP Server Builder

Guide for creating high-quality Model Context Protocol (MCP) servers that enable LLMs to interact with external services and APIs.

30 minutes
Advanced
Developer Tools

Nuxt UI Component Guidance

Build interfaces correctly with @nuxt/ui v4 — five core rules (UApp wrapper, semantic colors, reading generated theme files for real slot names, override priority, icon naming), a task-to-focus-area routing table, the Nuxt UI MCP server for live component API lookups, and full installation for both Nuxt and standalone Vue.

5 minutes
Beginner

Browse all Developer Tools playbooks →