Audit local AI coding-agent sessions with agenttrace for cost, tool failures, latency, anomalies, health, diffs, and CI gates.
npx skills add https://github.com/lingxling/awesome-skills-cn --skill agenttrace-session-audit
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.
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.
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.
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
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:
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.
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.
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.
--doctor when session discovery is uncertain.Solution: Run agenttrace --doctor, then point agenttrace at the exported file or log directory.
Solution: Compare the session against a prior attempt or known-good diff; cost metrics alone will miss semantic drift.
Solution: Start with JSON or Markdown reporting, inspect normal baselines, then tighten thresholds gradually.
@langfuse - Use for production LLM application tracing and evaluation.@observability-engineer - Use for broader service monitoring, SLOs, and incident workflows.Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Replace with description of the skill and when Claude should use it.
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Take lingxling/agenttrace-session-audit from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.