Trace Claude Code Sessions in LangSmith: Step‑by‑Step Setup Guide

By LatestLLM Editorial ·

Trace Claude Code Sessions in LangSmith: Step‑by‑Step Setup Guide

Learn how to install LangSmith's tracing plugin for Claude Code, configure a tiny JSON settings file, and view every agent interaction in LangSmith's Threads tab.

Ever wish your AI agent’s steps were as transparent as a glass box? Let’s turn Claude Code’s black‑box moments into clear, debuggable traces.

⚡ TL;DR: Install LangSmith’s tracing plugin for Claude Code, drop a tiny JSON settings file, and watch every message, tool call, and sub‑agent run appear in LangSmith’s Threads tab.

The Simple Version

We add a small plugin, create a one‑line settings file, and run Claude Code normally; the plugin streams everything to LangSmith.

🎯 Think of it this way: It’s like putting a camera on a magic trick so you can replay every move.

How It Actually Works

Install the LangSmith plugin

Run the one‑liner the video shows to pull the plugin into your environment.

Create the settings file

Open a JSON file and paste the three‑line config the presenter walks through.

🎯 Think of it this way: The file is a GPS coordinate that tells the plugin exactly where LangSmith lives.

Run Claude Code with tracing on

Execute your usual command; the plugin automatically streams every message, tool call, and sub‑agent run to LangSmith.

View the trace

Open the Threads tab in LangSmith and follow the full multi‑turn session step by step.

Technical Deep Dive

The plugin is called langsmith‑claude‑code and you install it with pip install langsmith‑claude‑code.

Then create a file at ~/.langsmith/settings.json and paste the three‑line config shown in the video.

The file points the plugin to LangSmith and tells it which project to use.

After that, run your Claude Code command; the plugin automatically streams every message, tool call, and sub‑agent run to LangSmith.

In LangSmith, open the Threads tab to see a hierarchical view of each turn, tool call, and sub‑agent execution.

Why This Matters

Debugging AI agents used to mean guessing where a failure occurred; now you can pinpoint the exact step that went wrong.

Teams can share traces with stakeholders, making collaboration on LLM‑powered workflows far smoother.

Faster iteration means you can ship smarter agents without spending hours on post‑mortems.

Key Takeaways

  • One plugin install adds full tracing for Claude Code.
  • A three‑line JSON settings file points the plugin to LangSmith.
  • Every message, tool call, and sub‑agent run is captured automatically.
  • You can replay entire sessions in the Threads tab.
  • Debugging time drops dramatically.
  • Shared traces improve team alignment on AI projects.
  • Setup takes under two minutes.

Source: “Trace Claude Code Sessions in LangSmith: Step‑by‑Step Setup Guide” on YouTube by LangChain

Tags: AI, LLM, LangChain, Claude Code, LangSmith, Tracing, Software Development

Related articles