New to Claude Skills? Learn how to install them →

sickn33 on GitHub

Agenttrace Session Audit

Free

Audit AI coding-agent sessions for performance insights.

Get this skill

Free · Opens the source repo

What Agenttrace Session Audit does

Agenttrace Session Audit is a skill designed for developers and teams who want to enhance their understanding of AI coding-agent sessions. By utilizing the agenttrace tool, this skill allows users to inspect local sessions for various metrics, including token and cost spikes, tool failures, latency issues, and anomalies. It is particularly useful for identifying why a session may have been slow or expensive, making it an essential tool for debugging and optimizing AI-assisted coding workflows.

The skill operates by reading session logs from a variety of AI coding tools such as Claude Code, Codex CLI, and others, allowing for a comprehensive analysis of the coding process. Users can generate human-readable reports in Markdown format, which highlight critical issues like repeated tool failures and low health scores. This reporting capability is crucial for teams looking to share findings or present them in a clear format.

One of the key features of this skill is its ability to compare different session attempts to identify semantic drift, which can occur even when performance metrics appear satisfactory. This comparison helps users ensure that the AI coding agent is following the intended paths and making appropriate decisions. Additionally, the skill can be integrated into Continuous Integration (CI) workflows, providing health checks and automation gates to maintain coding quality over time.

In summary, Agenttrace Session Audit serves as a powerful tool for anyone involved in AI-assisted coding, offering insights that can lead to improved performance and reliability of coding-agent sessions. It is particularly suited for developers who need to troubleshoot issues or optimize their workflows based on detailed session analysis.

When to use it

Use this skill when you need to analyze the performance of AI coding sessions or troubleshoot issues related to cost and latency.

When not to use it

This skill is not suitable for real-time monitoring or for analyzing sessions that are not stored locally or exported.

What you can build with it

Post-Session Analysis

After running an AI coding session, use this skill to analyze performance metrics and identify potential issues.

Continuous Integration Checks

Integrate this skill into your CI pipeline to automatically audit AI coding sessions for critical anomalies.

Comparative Session Review

When comparing two coding attempts, utilize this skill to spot differences in tool paths and performance metrics.

How to install Agenttrace Session Audit

View source

1. Install with the skills CLI

npx skills add sickn33/agentic-awesome-skills/agenttrace-session-audit --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 sickn33

agenttrace Session Audit

Overview

Use this skill to inspect local AI coding-agent sessions with agenttrace. It focuses on the process behind a run: token and cost spikes, tool failures, retry loops, latency gaps, anomalies, health scores, and session-to-session diffs.

agenttrace is local-first and reads session logs from tools such as Claude Code, Codex CLI, Gemini CLI, Aider, Cursor exports, OpenCode, Qwen Code, Kimi, and generic JSON or JSONL traces.

When to Use This Skill

  • Use when a user asks why an AI coding run was slow, expensive, shallow, or unreliable.
  • Use when reviewing local agent logs before retrying a failed or suspicious task.
  • Use when building a lightweight CI health gate for AI-assisted coding sessions.
  • Use when comparing two attempts and looking for changed tool paths, retries, or cost patterns.

How It Works

Step 1: Discover Available Sessions

Prefer an installed agenttrace binary when it is available on PATH. If the current repository is luoyuctl/agenttrace, use go run ./cmd/agenttrace instead.

agenttrace --doctor
agenttrace --overview

If no sessions are detected, report the directories checked by --doctor and ask for the exported session file or log directory.

Step 2: Produce a Human-Readable Audit

Use Markdown when the user wants a concise report they can inspect or share.

agenttrace --overview -f markdown -o agenttrace-overview.md

In the report, lead with the highest-risk sessions and explain why they matter: critical anomalies, repeated tool failures, token or cost waste, long latency gaps, low health scores, and suspiciously shallow sessions.

Step 3: Inspect One Session or Directory

Use the latest session for a quick check, or pass an explicit export path when the user provides one.

agenttrace --latest
agenttrace --latest -f json
agenttrace path/to/session-or-export.json
agenttrace --overview -d path/to/session-dir

Step 4: Compare Attempts When Semantics Matter

Token and latency metrics can look healthy even when an agent confidently takes the wrong implementation path. When the risk is semantic drift, pair the trace audit with a diff against a previous or known-good attempt.

Look for:

  • changed files or commands that diverge from the intended task
  • missing tests or verification steps compared with the reference attempt
  • repeated edits around the same files without a clear reason
  • lower cost that came from skipping necessary exploration

Step 5: Add Automation Gates

For CI or repeatable team workflows, use JSON output or health thresholds.

agenttrace --overview -f json -o agenttrace-overview.json
agenttrace --overview --fail-under-health 80 --fail-on-critical --max-tool-fail-rate 15

Tune thresholds to the project. A strict gate is useful for critical workflows; a reporting-only command is better while the team is learning its baseline.

Examples

Quick Local Review

agenttrace --overview
agenttrace --latest

Use this after a long coding-agent run to decide whether the next prompt should split the task, avoid a failing tool path, add missing tests, or reset context.

CI Health Check

agenttrace --overview --fail-under-health 80 --fail-on-critical

Use this when agent session logs are available in CI and the team wants a simple guard against critical anomalies or unhealthy runs.

Best Practices

  • Start with --doctor when session discovery is uncertain.
  • Report missing fields plainly; do not invent cost, model, latency, or health data.
  • Treat prompts, code, and session contents as private local data.
  • Prefer JSON output for automation and Markdown output for human review.
  • Use trace metrics for process failures and diff/reference review for semantic drift.

Limitations

  • agenttrace can only analyze logs that are present locally or provided as exports.
  • Some agents do not expose enough fields to infer cost, model, cache use, or latency.
  • Healthy trace metrics do not prove the final code is correct; still run tests and review diffs.
  • CI gates should start as advisory until the team understands normal baseline behavior.

Security & Safety Notes

  • Do not upload private session logs to external services unless the user explicitly approves it.
  • Do not overwrite user reports unless they requested that exact output path.
  • Avoid printing secrets found in prompts, tool output, environment variables, or logs.

Common Pitfalls

  • Problem: No sessions are found. Solution: Run agenttrace --doctor, then point agenttrace at the exported file or log directory.

  • Problem: A run looks cheap and fast but produced the wrong refactor. Solution: Compare the session against a prior attempt or known-good diff; cost metrics alone will miss semantic drift.

  • Problem: CI fails too often after adding a health gate. Solution: Start with JSON or Markdown reporting, inspect normal baselines, then tighten thresholds gradually.

Related Skills

  • @langfuse - Use for production LLM application tracing and evaluation.
  • @observability-engineer - Use for broader service monitoring, SLOs, and incident workflows.

Frequently asked questions about Agenttrace Session Audit

Similar skills