agent-tracing

Inspect recorded agent execution snapshots by operation ID via a CLI.

Updated Jan 27, 2026
One-click install
npx skills add https://github.com/SmallAi-API/smaihub --skill agent-tracing-smallai-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-tracing
Source: https://github.com/SmallAi-API/smaihub/tree/main/.agents/skills/agent-tracing
Command: npx skills add https://github.com/SmallAi-API/smaihub --skill agent-tracing-smallai-api

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Debugging agent runs requires visibility into what the LLM actually saw and did, but that context is scattered across logs, databases, and remote storage. This Skill records every agent execution step to disk as a snapshot and provides a CLI to inspect failed tool calls, LLM payloads, available tools, memory, and context engine input by operation ID. ## Core Features & Use Cases - Trace Inspection: List and inspect local, in-progress partial, and remote production snapshots, drilling into steps, messages, tool calls, events, and raw JSON. - Context Window Mapping: The ctx-map command renders each LLM call's message composition against the model's context window, including prefix-cache reuse and break points. - Model Replay: Re-issue a frozen recorded LLM call against other models with an llm-rubric judge to determine whether failures come from the model or the context. - Use Case: An agent operation failed in production. Run lh trace op inspect op_xxx to see the exact tool arguments and results, then use ctx-map to check whether an injected timestamp block broke prefix caching. ## Quick Start Ask the agent to inspect the latest agent trace and show the tool calls and LLM messages for the failing step.

Frequently Asked Questions about agent-tracing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I inspect an agent trace by operation ID?

Run agent-tracing inspect <traceId> from the repo root to see the step tree, then add flags like -s for a step, -m for messages, or -t for tool calls. For production traces, use lh trace op inspect <operationId> with a LobeHub login.

How to debug a failed tool call in an agent run?

Use agent-tracing inspect <traceId> -s <n> -t to view the exact tool arguments and results for that step, and -T to compare against the tools that were available. The snapshot records arguments, success status, and output per call.

Can I view traces from production or staging deployments?

Yes. Server deployments upload snapshots to object storage, and lh trace op inspect resolves and downloads them with a LobeHub session. The standalone CLI needs TRACING_BASE_URL configured and caches downloads under .agent-tracing/_remote/.

What does the ctx-map command show?

ctx-map renders one row per LLM call showing message segments sized by tokens against the model's context window. It also marks the cached prefix shared with the previous call and the first mutated message that broke cache reuse.

Why does replay not reproduce the recorded output exactly?

Sampling parameters like temperature and max_tokens are not recorded in snapshots, so replays use the server's current defaults. Model-to-model comparisons remain valid since every target gets the same request.