
Langsmith Fetch
Pull recent LangSmith execution traces from the terminal to see why LangChain or LangGraph agents failed, which tools ran, and how tokens were spent.
Install
npx skills add https://github.com/composiohq/awesome-claude-skills --skill langsmith-fetchWhat is this skill?
- Auto-triggers on phrases like debug my agent, show recent traces, check for errors, and review token usage
- Quick workflow: `langsmith-fetch traces --last-n-minutes 5 --limit 5 --format pretty`
- Covers tool-call flow, memory/LTM checks, and performance review from LangSmith Studio data
- Requires `pip install langsmith-fetch` plus LANGSMITH_API_KEY and LANGSMITH_PROJECT env vars
- Structured analyze-and-report steps after each fetch (counts, errors, patterns)
Adoption & trust: 2.2k installs on skills.sh; 63.7k GitHub stars; 2/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
Recommended Skills
Journey fit
Primary shelf is Operate → errors because the skill is invoked after failures or odd agent behavior to inspect traces and execution patterns. LangSmith trace fetch is diagnostic forensics on agent runs, aligned with error investigation rather than greenfield build or launch work.
Common Questions / FAQ
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.
SKILL.md
READMESKILL.md - Langsmith Fetch
# 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 ```bash pip install langsmith-fetch ``` ### 2. Set Environment Variables ```bash export LANGSMITH_API_KEY="your_langsmith_api_key" export LANGSMITH_PROJECT="your_project_name" ``` **Verify setup:** ```bash 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:** ```bash 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:** ```bash 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:** ```bash # 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?"