# Trace debug

> Trace debug is an open-source agent skill for developer tools. Investigates a production incident from a trace ID using Loki logs and Tempo traces. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/whitebeardit/claude-plugins/tree/main/sherlock-holmes/skills/trace-debug
- **Repository:** https://github.com/whitebeardit/claude-plugins
- **GitHub stars:** 13
- **License:** MIT
- **Skill name:** trace-debug
- **Collection:** https://github.com/whitebeardit/claude-plugins
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

Trace debug takes a trace ID or W3C traceparent and works out why a request failed, hung, ran slow or misbehaved. It runs a deterministic, read-only collector that gathers the matching Grafana Loki log lines and Grafana Tempo span tree, then has the agent build a timeline, find the first anomalous event, and reconstruct a causal chain from the evidence.

The report separates observed facts from inferences and hypotheses, assigns a confidence level, and lists gaps such as truncated or unavailable sources. It caps follow-up checks at three so the investigation stays focused. An optional step can render the span tree as an interactive sequence diagram through archify, showing call order and timing without asserting a cause.

The skill needs a Grafana instance with Loki and Tempo datasources, configured through environment variables or plugin settings, plus Python 3.8 or newer. Bundled recorded fixtures for six sample incidents let users try it without a live backend.

## When your agent uses it

> Investigate a production incident from a trace ID using Grafana Loki logs and Grafana Tempo traces. Use whenever the user provides a trace id or W3C traceparent and wants to know why a request failed, hung, was slow or misbehaved. Evidence-first - timeline, first anomalous event, causal chain, confidence, gaps. Optionally renders the span tree as an interactive sequence diagram (archify), evidence only. Read-only. The skill returns a finished report; present it to the user exactly as returned, in full, without summarizing or reformatting it.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Runs Python scripts](https://github.com/whitebeardit/claude-plugins/tree/HEAD/sherlock-holmes/skills/trace-debug)
- [Asks for: Bash(python3 *collect-trace.py*), Bash(python3 *trace-diagram.py*), Read, Bash(python *collect-trace.py*), Bash(py -3 *collect-trace.py*), Bash(python *trace-diagram.py*), Bash(py -3 *trace-diagram.py*)](https://github.com/whitebeardit/claude-plugins/blob/HEAD/sherlock-holmes/skills/trace-debug/SKILL.md)
- [Network calls found in its scripts](https://github.com/whitebeardit/claude-plugins/tree/HEAD/sherlock-holmes/skills/trace-debug)
- [License: MIT](https://github.com/whitebeardit/claude-plugins/tree/HEAD/sherlock-holmes/skills/trace-debug)

## Features

- **Evidence-first timeline:** Orders log lines and spans across services by recorded timestamp, noting gaps of a second or more.
- **First anomaly detection:** Locates the earliest abnormal event such as a timeout, dependency error or status 500.
- **Causal chain reconstruction:** Links the first anomaly to the final symptom using span parentage, propagated status and explicit upstream lines.
- **Confidence and gaps:** Labels each claim as fact, inference, hypothesis or unknown and states what the data does not show.
- **Span tree diagram:** Optionally renders the recorded span tree as an interactive sequence diagram without asserting a cause.
- **Bundled sample fixtures:** Includes recorded Loki and Tempo responses for six incident scenarios to try without a backend.

## Good for

- Explain why a request with a given trace ID returned a 503
- Find which downstream service first timed out in a slow checkout trace
- Check whether an error appears in Tempo spans but not in Loki logs
- Build a timeline of a failed request across services from its traceparent
- Identify gaps in logs for an incident that happened earlier today

## Install

### Claude Code

This skill ships in the `sherlock-holmes` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add whitebeardit/claude-plugins
/plugin install sherlock-holmes@whitebeard-plugins
```

Or copy only this skill to `~/.claude/skills/trace-debug`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/whitebeardit/claude-plugins.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/trace-debug &&
cp -R "$tmp/sherlock-holmes/skills/trace-debug" ~/.claude/skills/trace-debug &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/trace-debug` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/trace-debug` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/whitebeardit/claude-plugins.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/trace-debug &&
cp -R "$tmp/sherlock-holmes/skills/trace-debug" ~/.agents/skills/trace-debug &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/trace-debug` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/trace-debug` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/whitebeardit/claude-plugins.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/trace-debug &&
cp -R "$tmp/sherlock-holmes/skills/trace-debug" ~/.cursor/skills/trace-debug &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/trace-debug` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/whitebeardit/claude-plugins.git --path sherlock-holmes/skills/trace-debug
```

Or copy the folder to `~/.gemini/skills/trace-debug` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/trace-debug`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/whitebeardit/claude-plugins.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/trace-debug &&
cp -R "$tmp/sherlock-holmes/skills/trace-debug" ~/.copilot/skills/trace-debug &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/trace-debug` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/whitebeardit/claude-plugins.git
```

Then copy `claude-plugins/sherlock-holmes/skills/trace-debug` into your agent's skills folder as `trace-debug`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

A Grafana instance with Loki and Tempo datasources, the matching datasource UIDs, and credentials exported as environment variables such as GRAFANA_TOKEN. Python 3.8 or newer is required.

### Can I try Trace debug without a live Grafana setup?

Yes. Six bundled fixture sets with recorded Loki and Tempo responses can be passed to the collector with the fixture flag.

### Does Trace debug change anything in my systems?

No. The collector and diagram steps are read-only, and the skill is designed not to modify any data.

### What does the diagram show?

It draws the span tree as recorded, showing call order, time spent and which span failed first, but it does not show a cause.

### How do I install Trace debug in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/trace-debug to use it in all your projects, or to .claude/skills/trace-debug in one project. Or install the sherlock-holmes plugin, which includes it: /plugin marketplace add whitebeardit/claude-plugins, then /plugin install sherlock-holmes@whitebeard-plugins.

### Does Trace debug run scripts?

Yes. It runs Python scripts. Its scripts contain network calls. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Trace debug?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Trace debug?

The closest alternatives to Trace debug are Trace diagram, Setup, Trace debugging, Trace the flow and Error sweep.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Trace diagram](https://ai-powered.com/skills/trace-diagram): Trace diagram is an open-source agent skill for developer tools.
- [Setup](https://ai-powered.com/skills/setup-whitebeardit): Setup is an open-source agent skill for developer tools.
- [Trace debugging](https://ai-powered.com/skills/trace-debugging): Trace debugging is an open-source agent skill for developer tools.
- [Trace the flow](https://ai-powered.com/skills/trace-the-flow): Trace the flow is an open-source agent skill for developer tools.
- [Error sweep](https://ai-powered.com/skills/error-sweep): Error sweep is an open-source agent skill for developer tools.
- [AWS cloudwatch investigation](https://ai-powered.com/skills/aws-cloudwatch-investigation): AWS cloudwatch investigation is an open-source agent skill for cloud and infrastructure.
- [Arize trace](https://ai-powered.com/skills/arize-trace): Arize trace is an open-source agent skill for ai models and llm tooling.
- [Incident triage](https://ai-powered.com/skills/incident-triage-rpraharaj): Incident triage is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/trace-debug
