🛠️ LangSmith CLI
uv tool install langsmith-cli # or: pip install langsmith-cli
[!TIP]
Give Claude Code LangSmith superpowers
claude plugin marketplace add gigaverse-app/langsmith-cli
claude plugin install langsmith-cli@langsmith-cli
Or run /plugin inside Claude Code and add the marketplace from the UI. The plugin is a
skill, not an MCP server: it costs your agent no context until the agent actually
needs LangSmith.
🎯 Why LangSmith CLI?
LangSmith's base retention deletes traces after 14 days. langsmith-cli keeps them.
Traces land in your own S3 bucket as Parquet. The runs list, runs search and
runs get commands you use on live data then query a year of history, or a local
DuckDB cache that works offline.
- 🗄️ Your traces, your bucket, no expiry. A daily
archive sync exports each day before
LangSmith drops it. archive backfill pulls in history through LangSmith Bulk Export.
- 🦆 Offline, repeatable analysis. Pull traces into a local Parquet cache once. Every
query after that runs on your disk through DuckDB, with no API calls or rate limits.
- 🧠 Agent-sized answers.
--fields returns only what you ask for. On 12 real
production traces, full JSON was 2–34 KB. --fields id,name,status,error returned
108–128 bytes, 94.5–99.7% smaller.
- 🔌 Zero context until it's needed. The Claude Code plugin is an on-demand skill.
Sessions that never touch LangSmith spend no tokens on tool schemas.
- 📊 Answers, not dumps.
runs watch, sample, analyze, usage and stats
summarize thousands of runs. fields, tags, metadata-keys and describe show
what your traces contain before you query them.
- 🎨 Pleasant for humans too. Rich tables, regex and wildcard filters,
--last 24h,
plus CSV and YAML export.
💾 Parquet Trace Storage
One set of commands, three places your traces can live:
--source | What answers | Reach for it when… |
|---|
cloud (default) | The LangSmith API | You need what is true right now |
archive | Parquet in your organization's S3 bucket | The traces are older than LangSmith retention, or you need org-wide history |
local | A Parquet cache on this machine, queried with DuckDB | You're iterating on the same traces, or you're offline |
--source works on runs list, runs search, runs get, runs get-latest and
examples list, with the same filters and the same JSON, table, CSV and YAML output.
The CLI never switches sources behind your back, and reading never copies data: you
move traces only with explicit commands.
Archive: keep every trace in S3
# Daily job: export day D at D+2, then re-export it at D+12 to catch late runs,
# before LangSmith's 14-day retention removes it.
LANGSMITH_ARCHIVE_URI=s3://my-bucket/langsmith \
langsmith-cli --json archive sync --project prd/my-agent --retention-days 14
# One-time: backfill a year of history through LangSmith Bulk Export (resumable).
langsmith-cli --json archive backfill --config archive.yaml --route production \
--start-date 2025-08-01 --end-date 2026-08-01 \
--bulk-export-destination-id <uuid> --import-workers 8
# Query the archive exactly like live data.
langsmith-cli --json runs search "timeout" --source archive \
--project prd/my-agent --last 365d --fields id,name,status,error