Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
composiohq avatar

Langsmith Fetch

  • 3.2k installs
  • 71.1k repo stars
  • Updated July 24, 2026
  • composiohq/awesome-claude-skills

langsmith-fetch is a skill that pulls LangSmith execution traces into the terminal so developers can debug LangChain and LangGraph agent errors, tool calls, and performance.

About

The langsmith-fetch skill debugs LangChain and LangGraph agents by pulling execution traces from LangSmith Studio into the terminal. It activates when users ask to debug an agent, show recent traces, check errors, analyze memory operations, or review token usage. Prerequisites are pip install langsmith-fetch plus LANGSMITH_API_KEY and LANGSMITH_PROJECT environment variables. Core workflows include a quick debug of the last five minutes with pretty output, deep dives on a specific trace ID as JSON with root-cause analysis, exporting sessions to timestamped folders with traces and threads, and automated error detection across recent traces with grep-style failure patterns. Output formats are pretty, JSON, and raw, with filters for time ranges, metadata inclusion, and concurrent fetches for large exports. Common scenarios cover agents not responding, wrong tool selection, memory recall failures, and performance bottlenecks. Troubleshooting addresses missing traces, disabled LANGCHAIN_TRACING_V2, wrong project names, and API key issues before any fetch runs.

  • Fetches LangSmith traces via langsmith-fetch CLI with pretty, JSON, and raw output formats.
  • Four workflows: quick recent debug, trace deep dive, session export, and automated error detection.
  • Requires LANGSMITH_API_KEY and LANGSMITH_PROJECT plus pip install langsmith-fetch.
  • Covers tool-call review, memory operations, token usage, and execution-time analysis.
  • Troubleshooting for missing traces, disabled tracing, wrong project, and API key failures.

Langsmith Fetch by the numbers

  • 3,175 all-time installs (skills.sh)
  • +110 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #26 of 610 Debugging skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

langsmith-fetch capabilities & compatibility

Capabilities
fetch recent traces with time and limit filters · deep dive single trace json with root cause anal · export debug sessions with traces and threads · detect and summarize errors across recent runs
Works with
openai
Use cases
debugging · orchestration
From the docs

What langsmith-fetch says it does

Debug LangChain and LangGraph agents by fetching execution traces directly from LangSmith Studio in your terminal.
SKILL.md
pip install langsmith-fetch
SKILL.md
langsmith-fetch traces --last-n-minutes 5 --limit 5 --format pretty
SKILL.md
npx skills add https://github.com/composiohq/awesome-claude-skills --skill langsmith-fetch

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs3.2k
repo stars71.1k
Security audit2 / 3 scanners passed
Last updatedJuly 24, 2026
Repositorycomposiohq/awesome-claude-skills

How do I see what my LangChain or LangGraph agent actually did, which tools failed, and why a run errored?

Fetch LangSmith execution traces from the terminal to debug LangChain and LangGraph agent failures, tool calls, and performance.

Who is it for?

Developers running LangChain or LangGraph agents with LangSmith tracing who need terminal access to recent traces and failure analysis.

Skip if: Skip when LangSmith tracing is disabled, credentials are missing, or you need to change agent code rather than inspect traces.

When should I use this skill?

User asks to debug an agent, show recent LangSmith traces, check errors, analyze memory operations, or review agent performance.

What you get

Formatted trace listings or JSON deep dives with error breakdowns, tool-call order, token usage, and suggested fixes.

  • Terminal trace dumps
  • Tool-call timelines
  • Agent failure analysis notes

Files

SKILL.mdMarkdownGitHub ↗

LangSmith Fetch - Agent Debugging Skill

Debug LangChain and LangGraph agents by fetching execution traces directly from LangSmith Studio in your terminal.

When to Use This Skill

Automatically activate when user mentions:

  • 🐛 "Debug my agent" or "What went wrong?"
  • 🔍 "Show me recent traces" or "What happened?"
  • ❌ "Check for errors" or "Why did it fail?"
  • 💾 "Analyze memory operations" or "Check LTM"
  • 📊 "Review agent performance" or "Check token usage"
  • 🔧 "What tools were called?" or "Show execution flow"

Prerequisites

1. Install langsmith-fetch

pip install langsmith-fetch

2. Set Environment Variables

export LANGSMITH_API_KEY="your_langsmith_api_key"
export LANGSMITH_PROJECT="your_project_name"

Verify setup:

echo $LANGSMITH_API_KEY
echo $LANGSMITH_PROJECT

Core Workflows

Workflow 1: Quick Debug Recent Activity

When user asks: "What just happened?" or "Debug my agent"

Execute:

langsmith-fetch traces --last-n-minutes 5 --limit 5 --format pretty

Analyze and report: 1. ✅ Number of traces found 2. ⚠️ Any errors or failures 3. 🛠️ Tools that were called 4. ⏱️ Execution times 5. 💰 Token usage

Example response format:

Found 3 traces in the last 5 minutes:

Trace 1: ✅ Success
- Agent: memento
- Tools: recall_memories, create_entities
- Duration: 2.3s
- Tokens: 1,245

Trace 2: ❌ Error
- Agent: cypher
- Error: "Neo4j connection timeout"
- Duration: 15.1s
- Failed at: search_nodes tool

Trace 3: ✅ Success
- Agent: memento
- Tools: store_memory
- Duration: 1.8s
- Tokens: 892

💡 Issue found: Trace 2 failed due to Neo4j timeout. Recommend checking database connection.

---

Workflow 2: Deep Dive Specific Trace

When user provides: Trace ID or says "investigate that error"

Execute:

langsmith-fetch trace <trace-id> --format json

Analyze JSON and report: 1. 🎯 What the agent was trying to do 2. 🛠️ Which tools were called (in order) 3. ✅ Tool results (success/failure) 4. ❌ Error messages (if any) 5. 💡 Root cause analysis 6. 🔧 Suggested fix

Example response format:

Deep Dive Analysis - Trace abc123

Goal: User asked "Find all projects in Neo4j"

Execution Flow:
1. ✅ search_nodes(query: "projects")
   → Found 24 nodes

2. ❌ get_node_details(node_id: "proj_123")
   → Error: "Node not found"
   → This is the failure point

3. ⏹️ Execution stopped

Root Cause:
The search_nodes tool returned node IDs that no longer exist in the database,
possibly due to recent deletions.

Suggested Fix:
1. Add error handling in get_node_details tool
2. Filter deleted nodes in search results
3. Update cache invalidation strategy

Token Usage: 1,842 tokens ($0.0276)
Execution Time: 8.7 seconds

---

Workflow 3: Export Debug Session

When user says: "Save this session" or "Export traces"

Execute:

# Create session folder with timestamp
SESSION_DIR="langsmith-debug/session-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$SESSION_DIR"

# Export traces
langsmith-fetch traces "$SESSION_DIR/traces" --last-n-minutes 30 --limit 50 --include-metadata

# Export threads (conversations)
langsmith-fetch threads "$SESSION_DIR/threads" --limit 20

Report:

✅ Session exported successfully!

Location: langsmith-debug/session-20251224-143022/
- Traces: 42 files
- Threads: 8 files

You can now:
1. Review individual trace files
2. Share folder with team
3. Analyze with external tools
4. Archive for future reference

Session size: 2.3 MB

---

Workflow 4: Error Detection

When user asks: "Show me errors" or "What's failing?"

Execute:

# Fetch recent traces
langsmith-fetch traces --last-n-minutes 30 --limit 50 --format json > recent-traces.json

# Search for errors
grep -i "error\|failed\|exception" recent-traces.json

Analyze and report: 1. 📊 Total errors found 2. ❌ Error types and frequency 3. 🕐 When errors occurred 4. 🎯 Which agents/tools failed 5. 💡 Common patterns

Example response format:

Error Analysis - Last 30 Minutes

Total Traces: 50
Failed Traces: 7 (14% failure rate)

Error Breakdown:
1. Neo4j Connection Timeout (4 occurrences)
   - Agent: cypher
   - Tool: search_nodes
   - First occurred: 14:32
   - Last occurred: 14:45
   - Pattern: Happens during peak load

2. Memory Store Failed (2 occurrences)
   - Agent: memento
   - Tool: store_memory
   - Error: "Pinecone rate limit exceeded"
   - Occurred: 14:38, 14:41

3. Tool Not Found (1 occurrence)
   - Agent: sqlcrm
   - Attempted tool: "export_report" (doesn't exist)
   - Occurred: 14:35

💡 Recommendations:
1. Add retry logic for Neo4j timeouts
2. Implement rate limiting for Pinecone
3. Fix sqlcrm tool configuration

---

Common Use Cases

Use Case 1: "Agent Not Responding"

User says: "My agent isn't doing anything"

Steps: 1. Check if traces exist:

   langsmith-fetch traces --last-n-minutes 5 --limit 5

2. If NO traces found:

  • Tracing might be disabled
  • Check: LANGCHAIN_TRACING_V2=true in environment
  • Check: LANGCHAIN_API_KEY is set
  • Verify agent actually ran

3. If traces found:

  • Review for errors
  • Check execution time (hanging?)
  • Verify tool calls completed

---

Use Case 2: "Wrong Tool Called"

User says: "Why did it use the wrong tool?"

Steps: 1. Get the specific trace 2. Review available tools at execution time 3. Check agent's reasoning for tool selection 4. Examine tool descriptions/instructions 5. Suggest prompt or tool config improvements

---

Use Case 3: "Memory Not Working"

User says: "Agent doesn't remember things"

Steps: 1. Search for memory operations:

   langsmith-fetch traces --last-n-minutes 10 --limit 20 --format raw | grep -i "memory\|recall\|store"

2. Check:

  • Were memory tools called?
  • Did recall return results?
  • Were memories actually stored?
  • Are retrieved memories being used?

---

Use Case 4: "Performance Issues"

User says: "Agent is too slow"

Steps: 1. Export with metadata:

   langsmith-fetch traces ./perf-analysis --last-n-minutes 30 --limit 50 --include-metadata

2. Analyze:

  • Execution time per trace
  • Tool call latencies
  • Token usage (context size)
  • Number of iterations
  • Slowest operations

3. Identify bottlenecks and suggest optimizations

---

Output Format Guide

Pretty Format (Default)

langsmith-fetch traces --limit 5 --format pretty

Use for: Quick visual inspection, showing to users

JSON Format

langsmith-fetch traces --limit 5 --format json

Use for: Detailed analysis, syntax-highlighted review

Raw Format

langsmith-fetch traces --limit 5 --format raw

Use for: Piping to other commands, automation

---

Advanced Features

Time-Based Filtering

# After specific timestamp
langsmith-fetch traces --after "2025-12-24T13:00:00Z" --limit 20

# Last N minutes (most common)
langsmith-fetch traces --last-n-minutes 60 --limit 100

Include Metadata

# Get extra context
langsmith-fetch traces --limit 10 --include-metadata

# Metadata includes: agent type, model, tags, environment

Concurrent Fetching (Faster)

# Speed up large exports
langsmith-fetch traces ./output --limit 100 --concurrent 10

---

Troubleshooting

"No traces found matching criteria"

Possible causes: 1. No agent activity in the timeframe 2. Tracing is disabled 3. Wrong project name 4. API key issues

Solutions:

# 1. Try longer timeframe
langsmith-fetch traces --last-n-minutes 1440 --limit 50

# 2. Check environment
echo $LANGSMITH_API_KEY
echo $LANGSMITH_PROJECT

# 3. Try fetching threads instead
langsmith-fetch threads --limit 10

# 4. Verify tracing is enabled in your code
# Check for: LANGCHAIN_TRACING_V2=true

"Project not found"

Solution:

# View current config
langsmith-fetch config show

# Set correct project
export LANGSMITH_PROJECT="correct-project-name"

# Or configure permanently
langsmith-fetch config set project "your-project-name"

Environment variables not persisting

Solution:

# Add to shell config file (~/.bashrc or ~/.zshrc)
echo 'export LANGSMITH_API_KEY="your_key"' >> ~/.bashrc
echo 'export LANGSMITH_PROJECT="your_project"' >> ~/.bashrc

# Reload shell config
source ~/.bashrc

---

Best Practices

1. Regular Health Checks

# Quick check after making changes
langsmith-fetch traces --last-n-minutes 5 --limit 5

2. Organized Storage

langsmith-debug/
├── sessions/
│   ├── 2025-12-24/
│   └── 2025-12-25/
├── error-cases/
└── performance-tests/

3. Document Findings

When you find bugs: 1. Export the problematic trace 2. Save to error-cases/ folder 3. Note what went wrong in a README 4. Share trace ID with team

4. Integration with Development

# Before committing code
langsmith-fetch traces --last-n-minutes 10 --limit 5

# If errors found
langsmith-fetch trace <error-id> --format json > pre-commit-error.json

---

Quick Reference

# Most common commands

# Quick debug
langsmith-fetch traces --last-n-minutes 5 --limit 5 --format pretty

# Specific trace
langsmith-fetch trace <trace-id> --format pretty

# Export session
langsmith-fetch traces ./debug-session --last-n-minutes 30 --limit 50

# Find errors
langsmith-fetch traces --last-n-minutes 30 --limit 50 --format raw | grep -i error

# With metadata
langsmith-fetch traces --limit 10 --include-metadata

---

Resources

  • LangSmith Fetch CLI: https://github.com/langchain-ai/langsmith-fetch
  • LangSmith Studio: https://smith.langchain.com/
  • LangChain Docs: https://docs.langchain.com/
  • This Skill Repo: https://github.com/OthmanAdi/langsmith-fetch-skill

---

Notes for Claude

  • Always check if langsmith-fetch is installed before running commands
  • Verify environment variables are set
  • Use --format pretty for human-readable output
  • Use --format json when you need to parse and analyze data
  • When exporting sessions, create organized folder structures
  • Always provide clear analysis and actionable insights
  • If commands fail, help troubleshoot configuration issues

---

Version: 0.1.0 Author: Ahmad Othman Ammar Adi License: MIT Repository: https://github.com/OthmanAdi/langsmith-fetch-skill

Related skills

Forks & variants (1)

Langsmith Fetch has 1 known copy in the catalog totaling 23 installs. They canonicalize to this original listing.

How it compares

Use langsmith-fetch for LangSmith-backed agent trace forensics; use generic logging or Sentry when the failure is outside LangChain/LangGraph execution graphs.

FAQ

What do I need before using langsmith-fetch?

Install langsmith-fetch with pip and set LANGSMITH_API_KEY and LANGSMITH_PROJECT environment variables.

Which output formats does langsmith-fetch support?

Pretty for quick inspection, JSON for detailed analysis, and raw for piping to other commands.

Why might langsmith-fetch return no traces?

No recent agent activity, tracing disabled, wrong project name, or API key issues are the documented causes.

Is Langsmith Fetch safe to install?

skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Debuggingagentsautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.