langchain-ai avatar

Langsmith Trace

If you're running LangChain or LangGraph apps and need to debug why an agent took a weird path or build a dataset from real production traces, this gets you set up fast. It covers both sides: adding the @traceable decorator to your code (Python or TypeScript) and then querying that data via the langsmith CLI. The trace vs. run distinction matters here because traces give you the full execution tree while runs are just individual nodes, and you'll want traces first for most debugging work. The CLI filters are solid for finding slow traces, errors, or specific time windows. Good for turning observed behavior into datasets without manually crafting examples.

skills.sh installs
5K
GitHub stars
166
last updated
Aug 21, 2026

Install

$ npx -y skills add langchain-ai/langsmith-skills --skill langsmith-trace --agent claude-code

Installs into .claude/skills of the current project.

Files

Two main topics: **adding tracing** to your application, and **querying traces** for debugging and analysis. Python and Javascript implementations are both supported. Environment Variables
LANGSMITH_API_KEY=lsv2_pt_your_api_key_here          # REQUIRED
LANGSMITH_PROJECT=your-project-name                   # Optional: default project
LANGSMITH_WORKSPACE_ID=your-workspace-id              # Optional: for org-scoped keys

Authentication is REQUIRED. For agents, set the LANGSMITH_API_KEY environment variable (preferred); every langsmith command reads it automatically. To pass a key for a single command, use --api-key:

langsmith traces list --project my-project --api-key "$LANGSMITH_API_KEY"

IMPORTANT: Always check the environment variables or .env file for LANGSMITH_PROJECT before querying or interacting with LangSmith. This tells you which project contains the relevant traces and data. If the LangSmith project is not available, use your best judgement to identify the right one.

CLI Tool

curl -sSL https://raw.githubusercontent.com/langchain-ai/langsmith-cli/main/scripts/install.sh | sh

Sponsors

Details

Repository
github.com/langchain-ai/langsmith-skills
Categories
AI & Agent Building, CLI & Terminal

More from langchain-ai/langsmith-skills

All 3
1livekit avatarlivekit-agentslivekit/agent-skillsBuild voice AI agents with LiveKit Cloud and the Agents SDK. Use when the user asks to "build a voice agent", "create a LiveKit agent", "add voice AI", "impleme4.1Kskills.sh installs
2elastic avatarkibana-connectorselastic/agent-skillsCreate and manage Kibana connectors for Slack, PagerDuty, Jira, webhooks, and more via REST API or Terraform. Use when configuring third-party integrations or m2.9Kskills.sh installs
3launchdarkly avataraiconfig-createlaunchdarkly/agent-skillsaiconfig create2.3Kskills.sh installs
4launchdarkly avataraiconfig-toolslaunchdarkly/agent-skillsaiconfig tools2.3Kskills.sh installs
5launchdarkly avataraiconfig-updatelaunchdarkly/agent-skillsaiconfig update2.3Kskills.sh installs
6launchdarkly avataraiconfig-variationslaunchdarkly/agent-skillsaiconfig variations2.3Kskills.sh installs