langsmith-fetch
Debug LangChain and LangGraph agents by fetching execution traces from LangSmith Studio. Use when debugging agent behavior, investigating errors, analyzing tool calls, checking memory operations, or examining agent performance. Automatically fetches recent traces and analyzes execution patterns. Req
By composiohq · 3,656 installs
npx skills add composiohq/awesome-claude-skills --skill langsmith-fetch
Source repository · Upstream listing
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
2. Set Environment Variables
Verify setup:
Core Workflows
Workflow 1: Quick Debug Recent Activity
When user asks: "What just happened?" or "Debug my agent"
Execute:
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:
Workflow 2: Deep Dive Specific Trace
When user provides: Trace ID or says "investigate that error"
Execute:
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:
Workflow 3: Export Debug Session
When user says: "Save this session" or "Export traces"
Execute:
Report:
Workflow 4: Error Detection
When user asks: "Show me errors" or "What's failing?"
Execute:
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:
Common Use Cases
Use Case 1: "Agent Not Responding"
User says: "My agent isn't doing anything"
Steps:
1. Check if traces exist:
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:
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:
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)
Use for: Quick visual inspection, showing to users
JSON Format
Use for: Detailed analysis, syntax highlighted review
Raw Format
Use for: Piping to other commands, automation
Advanced Features
Time Based Filtering
Include Metadata
Concurrent Fetching (Faster)
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:
"Project not found"
Solution:
Environment variables not persisting
Solution:
Best Practices
1. Regular Health Checks
2. Organized Storage
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
Quick Reference
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