langsmith-trace

langsmith-trace is a skill for Claude Code, Codex from langchain-ai/skills-benchmarks. It costs 40 tokens per session (2,402 once invoked), scanned C, original, MIT.

Instructions for recording and querying execution traces in LangSmith, a service that shows what happens inside language-model applications and workflows.

In plain words
What is it for?
Use it to add tracing to LangChain or LangGraph applications, list runs, inspect traces, and export or query execution data.
Why use it?
It makes application runs easier to inspect by capturing steps, inputs, outputs, and related project data for debugging or review.

Skill for Claude CodeCodex ✓ vendor

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex; mentions Gemini CLI; mentions OpenCode.

Good fit Use it to add tracing to LangChain or LangGraph applications, list runs, inspect traces, and export or query execution data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/langchain-ai/skills-benchmarks/langsmith-trace
About the project

skills-benchmarks is a test suite that measures how the design of skill documentation affects Claude Code's adherence to recommended coding patterns. It is used to compare documentation approaches across LangChain-related tasks and other agent workflows. Its catalogue entries represent skills, hooks, instructions, and a plugin used in the benchmark project.

langchain-ai/skills-benchmarks · 116 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add langchain-ai/skills-benchmarks --skill langsmith-trace
Clone the repo
git clone --depth 1 https://github.com/langchain-ai/skills-benchmarks

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for langsmith-trace

README.md
[![agentmods](https://agentmods.dev/badge/skills/langchain-ai/skills-benchmarks/langsmith-trace/github.svg)](https://agentmods.dev/skills/langchain-ai/skills-benchmarks/langsmith-trace)
Your own site
<a href="https://agentmods.dev/skills/langchain-ai/skills-benchmarks/langsmith-trace"><img src="https://agentmods.dev/badge/skills/langchain-ai/skills-benchmarks/langsmith-trace/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for langsmith-trace

Your own site · 80×15
<a href="https://agentmods.dev/skills/langchain-ai/skills-benchmarks/langsmith-trace"><img src="https://agentmods.dev/badge/skills/langchain-ai/skills-benchmarks/langsmith-trace.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,402 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.02402
Opus 5 $0.00020 $0.01201
Sonnet 5 $0.00008 $0.00480
Haiku 4.5 $0.00004 $0.00240

Measured 10d ago against content hash 2758b65e692c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade C, and why

langsmith-trace scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

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

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sSL https://raw.githubusercontent.com/langchain-ai/langsmith-cli/main/scripts/install.sh | sh
skills/main/langsmith-trace/SKILL.md · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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: either set the LANGSMITH_API_KEY environment variable, or pass the --api-key flag to CLI commands (preferred):

langsmith trace 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

<trace_langchain_oss> For LangChain/LangGraph apps, tracing is automatic. Just set environment variables:

export LANGSMITH_TRACING=true
export LANGSMITH_API_KEY=<your-api-key>
export OPENAI_API_KEY=<your-openai-api-key>  # or your LLM provider's key

Optional variables:

  • LANGSMITH_PROJECT - specify project name (defaults to "default")
  • LANGCHAIN_CALLBACKS_BACKGROUND=false - use for serverless to ensure traces complete before function exit (Python) </trace_langchain_oss>

<trace_other_frameworks> For anything other than LangChain/LangGraph, read the matching reference file in references/ before writing tracing code. Each reference covers install, env vars, setup snippet, and gotchas specific to that framework. The setup is rarely identical across frameworks — picking the wrong pattern (e.g. using @traceable when the framework has native OTel) creates duplicate/missing spans.

Decision order:

  1. Framework has a dedicated reference below → use it
  2. Framework has native OpenTelemetry but no dedicated reference → references/otel.md
  3. No framework, or unsupported framework → references/traceable.md
  4. Cannot run a LangSmith SDK at all → references/api.md (last resort)

Routing table:

If you're tracing… Read
OpenAI / Azure OpenAI / Anthropic / any plain LLM client references/traceable.md
AutoGen references/autogen.md
CrewAI references/crewai.md
Google ADK references/google-adk.md
Google Gemini (google-genai SDK directly) references/google-gemini.md
Instructor (structured outputs) references/instructor.md
LiveKit Agents (voice AI) references/livekit.md
Mastra (TypeScript) references/mastra.md
Microsoft Agent Framework references/microsoft-agent-framework.md
Mistral references/mistral.md
n8n (self-hosted) references/n8n.md
OpenAI Agents SDK references/openai-agents-sdk.md
OpenCode references/opencode.md
OpenAI Codex CLI references/codex.md
Pipecat (voice AI) references/pipecat.md
PydanticAI references/pydantic-ai.md
Semantic Kernel references/semantic-kernel.md
Strands Agents references/strands-agents.md
Temporal workflows (Go/Python/TS) references/temporal.md
Vercel AI SDK references/vercel-ai-sdk.md
Any other framework with native OTel references/otel.md
Multi-backend OTel fan-out references/otel.md (Collector section)
Raw REST (no SDK available) references/api.md

If the framework you need isn't listed here, check references/ — new integrations are added there, not inline. </trace_other_frameworks>

<traces_vs_runs> Use the langsmith CLI to query trace data.

Understanding the difference is critical:

  • Trace = A complete execution tree (root run + all child runs). A trace represents one full agent invocation with all its LLM calls, tool calls, and nested operations.
  • Run = A single node in the tree (one LLM call, one tool call, etc.)

Read the full file on GitHub · 228 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 228 lines · 40 tokens per session scan C 2758b65e692c

Subscribe to this mod's changes

langsmith-trace is a skill published in the GitHub repository langchain-ai/skills-benchmarks (116 stars, last pushed 21d ago), licensed MIT. It adds 40 tokens to every session and 2,402 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

agent-platform-rag-engine-management

Manage and query Agent Platform RAG Engine Corpora and retrieve grounded contexts using the Google GenAI SDK. Use when listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus. Do not use for standard database queries (use SQL/Spanner skills), Google…

google/skills · 85 tokens

agent-platform-model-registry

Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.

google/skills · 60 tokens

foundry-config-setup

Resolve missing setup caused by a hardcoded Foundry project endpoint or model in a sample. Use when a sample fails because it uses a placeholder/hardcoded projectendpoint (for example "https://your-project.services.ai.azure.com") or a hardcoded model instead of reading them from the environment.

microsoft/agent-framework · 65 tokens

google-cloud-solution-agentic-analytics-spark-knowledge-catalog

Discovers requirements and generates guidance to design and deploy a governed, secure agentic-analytics solution for data that's distributed across Google Cloud, other cloud providers, or on-premises. Data that's outside Google Cloud (such as data from Databricks, Snowflake, Salesforce, SAP, or Oracle systems) is…

google/skills · 138 tokens

training-check

Interactively monitor training metrics from the current Codex session, periodically checking WandB or fallback logs for NaN, divergence, plateaus, and broken runs.

wanshuiyin/Auto-claude-code-research-in-sleep · 35 tokens

nemo-automodel-launcher-config

Configure NeMo AutoModel job launches for interactive runs, Slurm clusters, and SkyPilot cloud execution.

NVIDIA/skills · 30 tokens