Agent skill · research science · jeremylongshore

langchain-debug-bundle

Produce a reproducible, sanitized diagnostic bundle for a LangChain\

Why this skill is useful

Adds a complete diagnostic bundle generation script for LangChain incidents, enabling reproducibility and effective debugging.

What it needs

Requires python installed locally. Requires langsmith account access. About 8k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

LangChain Debug Bundle (Python) Overview An on-call engineer pages you at 2am: the production agent loops, ToolMessage outputs are empty strings, the user sees "I could not find the answer." Someone asks the right question — what state was the graph in when it gave up? — and there is no answer, because the terminal that caught the failure is already gone, the Kubernetes pod has restarted, and the LangSmith URL was never recorded. This skill produces one artifact: a single bundle-<incidentid>.tar.gz (typically 1-10 MB) containing everything a second engineer needs to reproduce the failure without a live terminal — environment and version manifest, filtered astreamevents(version="v2") JSONL, a propagating callback stack, the LangSmith trace URL, and a post-write sanitization pass. Four pitfalls make naive bundles useless: P01 — ChatAnthropic.stream() reports tokenusage only on stream close; token math read from onllmend lags by stream duration, so cost context in the bundle is wrong. P28 — BaseCallbackHandler.withconfig(callbacks=[...]) does NOT propagate into subgraphs or inner createreactagent loops. A debug callback bound that way silently captures zero events from the place the incident actually happened. P47 — astreamevents(version="v2") emits 2,000+ events per invocation. A raw dump is 50 MB and unreadable; an SSE viewer crashes on it. P67 — astreamlog() is soft-deprecated in 1.0. Diagnostic tooling built on it breaks on the next minor version. The skill's answer: assemble the manifest, capture v2 events with a whitelist (drop lifecycle noise, keep onchatmodelstream / ontool / any error event), attach DebugCallbackHandler via config["callbacks"] at invoke time, pull the LangSmith URL from the active RunTree, run the sanitization pass, tar it up. Pinned: langchain-core 1.0.x, langgraph 1.0.x, langsmith 0.1.x. Pain-catalog anchors: P01, P28, P47, P67. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/langchain-debug-bundle--1683e1

View the source on GitHub

Browse the @skills marketplace