# Trace QA

Analyze and answer questions about agent execution traces.

- Repository: https://github.com/dp-archive/archive (1107 stars)
- Category: Testing
- License: Apache-2.0
- Last updated: 2026-03-04
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add dp-archive/archive --skill trace-qa -g -a claude-code -y`
Codex: `npx skills add dp-archive/archive --skill trace-qa -g -a codex -y`
Cursor: `npx skills add dp-archive/archive --skill trace-qa -g -a cursor -y`
Gemini CLI: `npx skills add dp-archive/archive --skill trace-qa -g -a gemini-cli -y`

## Description

Analyze and answer questions about agent execution traces. Use this skill when the user asks about a trace, wants to debug a failed agent run, understand what an agent did, analyze token usage or efficiency, or asks "what happened in trace X". Triggers: trace analysis, trace debugging, trace QA, execution review, agent run review.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Trace QA

Analyze agent execution traces to answer questions about what happened, why it failed,
how efficient it was, or any other aspect of the run.

## Workflow

Always start with `overview` to understand the trace before diving into details.

### 1. Get the overview first

```bash
python scripts/fetch_trace.py <trace_id> overview
```

This returns metadata (status, duration, tokens, model) and summaries (request, answer preview, tool usage counts). Use this to orient yourself before going deeper.

### 2. Explore steps or LLM calls as needed

Depending on the user's question, drill into the relevant data:

| User wants to know... | Command |
|------------------------|---------|
| What tools were called and in what order | `steps [start] [count]` |
| Full input/output of a specific tool call | `step <N>` |
| How many LLM calls and their token costs | `llm-calls [start] [count]` |
| What messages were sent to Claude in a specific turn | `llm-call <N>` |
| Just the final result | `answer` |

### 3. Handle long content with segmented reads

When content is large, the script automatically segments output to ~4000 characters.
If you see a `[CONTINUED: ...]` message at the end of output, call the command shown
in that message to read the next segment. Repeat until all content is read.

Example sequence:
```bash
python scripts/fetch_trace.py <id> step 5
# Output ends with: [CONTINUED: use 'step 5 --offset 4000' for next segment]

python scripts/fetch_trace.py <id> step 5 --offset 4000
# Output ends with: [CONTINUED: use 'step 5 --offset 8000' for next segment]

python scripts/fetch_trace.py <id> step 5 --offset 8000
# Full content now read
```

## Command Reference

The rest: https://github.com/dp-archive/archive/blob/HEAD/seed_skills/trace-qa/SKILL.md
