llm-log-analyzer

Analyze LLM gateway request and response logs for troubleshooting and performance.

2|Updated Jun 25, 2026
One-click install
npx skills add https://github.com/cc-claws/cc-code --skill llm-log-analyzer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: llm-log-analyzer
Source: https://github.com/cc-claws/cc-code/tree/main/.claude/skills/llm-log-analyzer
Command: npx skills add https://github.com/cc-claws/cc-code --skill llm-log-analyzer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

这个 Skill 用来快速读懂 LLM 网关和代理产生的请求、响应与流式日志,帮助你从一堆 data 目录记录里找出发生了什么、哪里失败了、以及为什么 token 和缓存表现异常。

Core Features & Use Cases

  • 请求与会话追踪:按 request id、session id、时间范围浏览请求链,查看每一轮消息、工具调用和响应摘要。
  • 缓存与成本诊断:分析 prompt cache 命中率、缓存写入、冷启动与前缀不稳定问题,定位 token 浪费来源。
  • 上下文膨胀排查:观察 session 中消息数和 token 规模如何增长,判断是大工具输出、compact 太晚,还是回注风暴导致上下文失控。
  • 差异对比与统计汇总:比较两轮请求差异,或者按模型、路由、session、小时维度做整体统计。
  • 使用场景:当你想知道“哪个请求失败了”“某个 session 为什么越来越慢”“为什么缓存命中率突然下降”时,这个 Skill 可以直接给出可操作的诊断结论。

Quick Start

请使用这个 skill 分析 data 目录中的 LLM 日志,先列出请求概况,再检查缓存命中率,并定位指定 session 的请求链与异常。

Frequently Asked Questions about llm-log-analyzer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze LLM gateway logs to troubleshoot failed requests?

To analyze LLM gateway logs, this Skill parses request.json and stream.log files in a data directory to inspect session timelines, stream events, and request diffs for troubleshooting failed requests and identifying root causes.

How do I diagnose prompt cache hit rate drops and token waste in LLM logs?

Diagnosing prompt cache hit rate drops involves analyzing cache hit patterns, cache writes, and cold starts in LLM logs to pinpoint token waste sources and identify prefix instability issues.

How can I trace session context bloat and escalating token usage across request chains?

Tracing session context bloat requires inspecting LLM session timelines to observe token scale growth and message counts, helping determine if large tool outputs or delayed compaction cause context overflow.

Does this log analyzer support both Anthropic and OpenAI-style stream parsing?

Yes, stream parsing supports both Anthropic and OpenAI-style streams, structuring stream events from LLM gateway logs while maintaining compatibility with legacy response files.

What is the best way to compare two LLM requests and summarize token statistics by model?

Comparing two LLM requests and summarizing token statistics is done by performing request diffs and aggregating overall statistics by model, route, session, and hourly dimensions.

What structured input format is required for LLM session tracing and cache analysis?

Structured input for LLM session tracing requires a data directory containing request.json and stream.log files, enabling structured parsing of request chains, cache patterns, and token usage.