Skip to content
Back to skills

Agent Trace Debugger

ASecurity

Parse .trace.json files and correlate with backend events and tool calls. Use when debugging agent behavior, investigating tool call patterns, or validating concurrency limits.

  • 12 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 28, 2026
ai-agentstypescriptsqldebuggingdatabasebackend

Works with

  • mcp

Security analysis

A100/100

Scanned September 28, 2026

npx -y skills add fritzprix/libr-agent --skill agent-trace-debugger --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Agent Trace Debugger?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Agent Trace Debugger
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/fritzprix-agent-trace-debugger/badge)](https://www.skillsdirectory.com/skills/fritzprix-agent-trace-debugger)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
name: agent-trace-debugger
description: Parse .trace.json files and correlate with backend events and tool calls. Use when debugging agent behavior, investigating tool call patterns, or validating concurrency limits.
---

# Agent Trace Debugger

Parse and analyze LibrAgent agent session trace files (`.trace.json`).

## Trace File Location

Trace files are typically stored in:

- `~/.libragent/traces/<session_id>.trace.json`
- Session-specific directories under the app data folder

## Analysis Workflow

### 1. Load Trace File

```typescript
import { readFileSync } from 'fs';
const trace = JSON.parse(readFileSync('session.trace.json', 'utf-8'));
```

### 2. Extract Tool Call Sequence

```typescript
const toolCalls = trace.messages
  .filter((m) => m.role === 'assistant' && m.tool_calls)
  .flatMap((m) => m.tool_calls);
```

### 3. Correlate with Backend Events

Match trace tool calls with `agent:event` payloads:

- `agent:thinking` - LLM reasoning phase
- `agent:tool_start` - Tool execution start
- `agent:tool_end` - Tool execution complete
- `agent:error` - Error during execution

### 4. Identify Workflow Phases

LibrAgent uses Think-Act-Observe loop:

- **Think**: LLM generates reasoning and tool calls
- **Act**: Backend executes tools via `MCPServiceProxy`
- **Observe**: Backend adds results to conversation, loop continues

### 5. Detect Issues

- Failed tool calls without retry
- Long-running tool executions
- Missing tool results in conversation
- Cross-session state leakage (check session IDs)

## Key Patterns to Look For

```json
{
  "session_id": "uuid-here",
  "messages": [
    {
      "role": "user",
      "content": "Task description"
    },
    {
      "role": "assistant",
      "content": "Reasoning...",
      "tool_calls": [
        {
          "id": "call_123",
          "function": {
            "name": "planning_create_task",
            "arguments": "{\"title\": \"Task\"}"
          }
        }
      ]
    },
    {
      "role": "tool",
      "tool_call_id": "call_123",
      "content": "Task created"
    }
  ]
}
```

## Integration with Other Tools

- `extract-log-debug` skill: Extract matching log entries for the same session
- `trace-analyzer` skill: Deep analysis of trace file structure
- `sqlite-analyzer` skill: Verify database state matches trace expectations

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.