peri: Skill for Claude Code

.claude/skills/llm-log-analyzer/SKILL.md

llm-log-analyzer is a skill for Claude Code from KonghaYao/peri. It costs 117 tokens per session (3,356 once invoked), scanned A, original, Apache-2.0.

A reader for logs produced by an LLM gateway, a service that forwards requests between an application and a language-model provider. It reads request files and streamed or regular responses, including model, messages, tools, session IDs, and token-usage data.

In plain words
What is it for?
Use it to inspect the data directory, follow a session’s requests, compare requests, check token consumption, and find failed language-model calls.
Why use it?
It makes it easier to inspect what language-model requests were sent and how they finished. It can also group requests by session and identify failed requests or token usage.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is KonghaYao/peri's own configuration. It tells Claude Code how to work on peri itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything peri configures →

Reuse

Borrowing it

Nothing to install: this file belongs to KonghaYao/peri. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/KonghaYao/peri/main/.claude/skills/llm-log-analyzer/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/KonghaYao/peri

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for llm-log-analyzer

README.md
[![agentmods](https://agentmods.dev/badge/skills/konghayao/peri/llm-log-analyzer.svg)](https://agentmods.dev/skills/konghayao/peri/llm-log-analyzer)
Your own site
<a href="https://agentmods.dev/skills/konghayao/peri/llm-log-analyzer"><img src="https://agentmods.dev/badge/skills/konghayao/peri/llm-log-analyzer.svg" alt="Measured on agentmods" height="20"></a>
Per session 117 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,356 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00117 $0.03356
Opus 5 $0.00059 $0.01678
Sonnet 5 $0.00023 $0.00671
Haiku 4.5 $0.00012 $0.00336

Measured 8d ago against content hash 27cbb4f27036, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

llm-log-analyzer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/context-growth.mjs, scripts/llm-log-query.mjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/llm-log-analyzer/SKILL.md · 218 lines

How it starts

The opening of the file, as written. The whole thing — 218 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LLM Log Analyzer

分析 ./data/ 下的 LLM 请求/响应日志。

日志结构

每个请求对应一个目录,命名格式 YYYY-MM-DD_HH-MM-SS-mmm_NNNN

新格式(当前)

data/
└── 2026-05-20_03-56-28-921_0014/
    ├── request.json      # { headers: {...}, body: {...} }
    └── stream.log         # SSE 流式响应原文(含 usage 数据)

旧格式(兼容)

data/
└── 2026-05-14_10-30-15-123_0003/
    ├── request.json      # { headers?: {...}, body?: {...} } 或裸 body
    ├── response.json      # JSON 响应(非流式)
    ├── stream.log         # SSE 流式响应原文
    └── log.txt            # 终端格式的人类可读日志

request.json 格式{ "headers": {...}, "body": {...} }。body 包含以下字段:

  • model:模型名称(如 deepseek-v4-pro
  • system:system prompt 数组(Anthropic 格式),每项含 text + 可选 cache_control
  • messages:消息数组
  • tools:工具定义数组(Anthropic 格式用 name,OpenAI 格式用 function.name
  • thinking:推理配置(如 {"type": "enabled", "budget_tokens": 8000}
  • output_config:输出配置(如 {"effort": "high"}
  • stream:是否流式(true
  • max_tokens:最大输出 token

headers 中的 x-session-id 可按 session 追踪同一 agent 的多次请求。host 头用于推断 API 路由(如 api.deepseek.comdeepseek)。

stream.log 格式:SSE 事件流,包含:

  • message_start:初始 usage(input_tokenscache_read_input_tokenscache_creation_input_tokensoutput_tokens=0
  • content_block_start/delta/stop:thinking、text、tool_use 内容块
  • message_delta:最终 usage(含实际 output_tokens)+ stop_reason
  • message_stop:流结束标记

工具自动从 stream.logmessage_delta 事件提取 token usage 数据,无需 response.json

分析工具

scripts/llm-log-query.mjs 提供以下子命令,用 bun run scripts/llm-log-query.mjs <command> 运行:

list — 列出请求摘要

bun run scripts/llm-log-query.mjs list [--dir ./data] [--limit 20] [--model NAME] [--session ID] [--route openai|anthropic|deepseek] [--after YYYY-MM-DD] [--before YYYY-MM-DD] [--errors]

输出表格:序号 | 请求ID | 时间 | 路由 | 模型 | Session | 消息数 | 状态 | 延迟

show — 查看单个请求详情

bun run scripts/llm-log-query.mjs show <request-id> [--dir ./data] [--body] [--messages] [--tools] [--stream]
  • 默认显示摘要(headers、模型、状态、延迟、token 用量、thinking 配置、output_config)
  • --body 显示完整请求体
  • --messages 显示 system blocks + 消息列表(role + 内容前 100 字),system blocks 标注 [cached]
  • --tools 显示工具定义列表,标注 [cached] 的 cache_control 状态
  • --stream 解析 stream.log 中的 SSE 事件
  • response.json 时,自动从 stream.log 提取响应(stop_reason、thinking、content、tool_calls)

Read the full file on GitHub · 218 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 218 lines · 117 tokens per session scan A 27cbb4f27036

Subscribe to this mod's changes

llm-log-analyzer is a skill published in the GitHub repository KonghaYao/peri (163 stars, last pushed today), licensed Apache-2.0. It adds 117 tokens to every session and 3,356 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

qa-testing

Verify your work by actually operating the app or website you changed, instead of assuming it works. Strongly recommended whenever you build, modify, or debug a web app, website, or desktop GUI app. Drive real browsers with the agent-browser CLI and native desktop apps with the cua-driver CLI. These are installed on…

openinterpreter/openinterpreter · 77 tokens

pi-loop-forensics

Diagnose pi-go agent loops and degenerate turns — "agent loop aborted", runaway thinking with no tool calls, repeated phrases. Discriminates genuine model repetition collapse from a race, a tool-parse failure, or a too-low guard, and A/B replays a seed session across providers.

dimetron/pi-go · 65 tokens

nightly-session-watch

Nightly sweep of the last 24h of pi-go sessions — anomalous runs, loop aborts, tool error rates, token waste, real prompt-token spend, and whether the observation and palace pipelines are still recording. Triages each finding to the specialist skill that diagnoses it. Use for an unattended daily health check, or on…

dimetron/pi-go · 78 tokens

memory-status

Show MemPalace memory system status — drawer counts, wings, rooms, knowledge graph stats, and embedding model state.

dimetron/pi-go · 27 tokens

code-review-pi

Review code for quality, run linters, check test coverage, fix issues, and enforce gates. Save the final report to ./specs/issues/003-code-review-pi/PROMPT.md. Use before committing changes.

dimetron/pi-go · 50 tokens

plugin-creator

Create and scaffold plugin directories for Codex with a required .codex-plugin/plugin.json, optional plugin folders/files, valid manifest defaults, and personal-marketplace entries by default. Use when Codex needs to create a new personal plugin, add optional plugin structure, generate or update marketplace entries…

openinterpreter/openinterpreter · 86 tokens