New to Claude Skills? Learn how to install them →

langchain-ai on GitHub

Deep Agents Thread Inspector

Free

Inspect and explain local Deep Agents session conversations.

Get this skill

Free · Opens the source repo

What Deep Agents Thread Inspector does

The Deep Agents Thread Inspector is a specialized tool designed for developers and data scientists working with Deep Agents in their local environment. It allows users to inspect and analyze conversations stored in the local SQLite session database, specifically when the LangSmith trace tooling is not available. This skill is particularly useful for offline sessions or when dealing with untraced interactions, enabling users to retrieve and summarize threads, inspect checkpoint metadata, and list recent local threads effectively.

Using the provided Python script, inspect_sessions.py, users can open the session database in a read-only mode and deserialize messages using LangGraph's MsgPack loader. This process ensures that the messages are read in the correct order, either from the latest checkpoint or by replaying writes when necessary. The output is presented in JSON format, making it easy to work with programmatically or for further analysis.

The skill offers various modes of inspection, including viewing the latest turn, summarizing the conversation, or displaying the full transcript. Users can also include metadata or adjust the character limit for message content as needed. If users are unsure of the thread ID, the tool can list recent threads, simplifying the process of finding specific conversations. This flexibility makes it an essential resource for anyone needing to troubleshoot or analyze their interactions with Deep Agents.

Safety is a priority with this tool, as it maintains a read-only approach to inspection, ensuring that no changes can be made to the session data. This feature is crucial for maintaining the integrity of the data while allowing users to perform necessary inspections and analyses without risk of corruption or data loss.

When to use it

Use this tool when LangSmith tooling is unavailable, or when you need to inspect local session data without tracing.

When not to use it

This is not suitable for real-time tracking of sessions or for environments where LangSmith is available and preferable.

What you can build with it

Inspecting Offline Sessions

Use the Deep Agents Thread Inspector to analyze conversations from sessions where LangSmith is not available, ensuring you can still extract valuable insights.

Troubleshooting Session Data

When encountering issues with Deep Agents, this tool helps you inspect the local session data to identify problems or inconsistencies.

Summarizing Conversations

Quickly generate summaries of recent interactions with Deep Agents to review and understand the context without manually sifting through raw data.

How to install Deep Agents Thread Inspector

View source

1. Install with the skills CLI

npx skills add langchain-ai/deepagents/deepagents-thread-inspector --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by langchain-ai

Deep Agents Thread Inspector

If LangSmith tooling is available for a traced thread, prefer it. Otherwise, use scripts/inspect_sessions.py instead of manually decoding database blobs. It opens the database read-only and deserializes the root message channel with LangGraph's strict MsgPack loader — reading the materialized messages from the latest checkpoint, or replaying writes in checkpoint order when that fast path is unavailable — and emits JSON.

Inspect local state

Resolve SKILL_DIR to the directory containing this SKILL.md; do not assume a user, project, or installation-specific location. Start with the smallest useful view:

python3 "$SKILL_DIR/scripts/inspect_sessions.py" THREAD_ID --mode latest-turn

A unique thread-ID prefix is accepted. Select another view when needed:

python3 "$SKILL_DIR/scripts/inspect_sessions.py" THREAD_ID --mode summary
python3 "$SKILL_DIR/scripts/inspect_sessions.py" THREAD_ID --mode transcript

Use --include-metadata only when run, repository, model, checkpoint, or LangGraph metadata matters. Use --max-content N to raise or lower the default 4,000-character limit per message, tool result, or tool-call argument.

If the user does not know the ID, list recent threads first:

python3 "$SKILL_DIR/scripts/inspect_sessions.py" --list 20

Pass --db PATH only for a non-default session store. The default is ~/.deepagents/.state/sessions.db; DEEPAGENTS_SESSIONS_DB can override it.

Explain the result

Synthesize the JSON rather than pasting it verbatim.

  • State the user's request, the assistant's conclusion, and significant tool actions or failures.
  • Distinguish stored facts from your interpretation.
  • For the latest turn, describe only the final user message and subsequent activity unless earlier context is required to make it understandable.
  • Mention truncation when a relevant record has content_truncated or args_truncated set.
  • Surface reconstruction problems when the result includes a top-level warnings array (for example, a corrupt checkpoint, a skipped write, or malformed metadata) so conclusions are appropriately hedged.
  • Do not expose unrelated credentials, tokens, personal data, or hidden reasoning that may appear in local records.

Safety

Keep inspection read-only. Do not deserialize an untrusted database: checkpoint deserialization is intended for trusted local Deep Agents state. Do not mutate or delete session rows unless the user separately and explicitly requests it.

Frequently asked questions about Deep Agents Thread Inspector

Similar skills