log-analyzer

log-analyzer is a skill for Claude Code, Codex from ntygod/ZhiWei. It costs 39 tokens per session (662 once invoked), scanned A, original, MIT.

A guide for examining application log files, which record events and errors produced by software. It focuses on finding failures, unusual activity, repeated errors, and important events.

In plain words
What is it for?
Use it to find errors and stack traces, count recurring failures, filter logs by time, connect events across files, and produce a prioritised report.
Why use it?
It reduces the need to search large log files manually and helps separate urgent failures from frequent but less serious warnings. It also keeps sensitive details out of reports.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to find errors and stack traces, count recurring failures, filter…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ntygod/zhiwei/log-analyzer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ntygod/ZhiWei --skill log-analyzer
Clone the repo
git clone --depth 1 https://github.com/ntygod/ZhiWei

Made for: Claude Code, Codex.

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 log-analyzer

README.md
[![agentmods](https://agentmods.dev/badge/skills/ntygod/zhiwei/log-analyzer.svg)](https://agentmods.dev/skills/ntygod/zhiwei/log-analyzer)
Your own site
<a href="https://agentmods.dev/skills/ntygod/zhiwei/log-analyzer"><img src="https://agentmods.dev/badge/skills/ntygod/zhiwei/log-analyzer.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 662 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.
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.00039 $0.00662
Opus 5 $0.00019 $0.00331
Sonnet 5 $0.00008 $0.00132
Haiku 4.5 $0.00004 $0.00066

Measured 7d ago against content hash 5c6b9146de82, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

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 7d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/log-redact.py), 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.

src/main/resources/skills/log-analyzer/SKILL.md · 51 lines

What it actually says

日志分析指南

shell_exec 用 grep / Select-String 扫日志,file_read 按行读关键段。领域强化:报告引用的日志原文必须实际读到,并且对敏感信息(IP / 用户名 / Token / 邮箱 / 手机号)脱敏后输出。

适用场景

  • 排查报错("刚才报错了 / 看下错误日志")
  • 追踪异常 + 堆栈("X 这个异常哪来的 / 看完整堆栈")
  • 错误频率统计("这周 ERROR 多少次 / 最高频是哪个")
  • 提取关键事件(启动 / 关闭 / 崩溃 / 慢查询)
  • 时间窗口过滤("昨天下午 3 点的日志")
  • 多日志关联(一次请求跨多文件)

不适用场景

  • 系统级资源诊断 → healthcheck
  • 代码级 bug 调试 → code-assistant
  • 实时监控告警 → cron-scheduler + shell_exec

工作流

  1. 定位日志file_read 列 log 目录;常见路径见参考(/var/log / 知微 dataDir 下 logs 等)
  2. 快速扫描:按平台用对应工具的 ERROR/Exception 模式匹配抓异常行(具体命令模板见参考)
  3. 统计分布:按错误类型排序,前 20 看高频
  4. 大文件分段读:日志通常很大,file_readstartLine / endLine 按行号读,不一次性 file_read 整个文件
  5. 时间窗口:日志带时间戳的,先按时间前缀模式缩小范围(<日期> <时间起>: 匹配前缀)
  6. 堆栈追踪:异常行后续 -A 20 拿完整堆栈
  7. 脱敏处理:按参考里的正则替换 IP / Token / 邮箱 / 手机号 / 用户 ID 后再写入报告
  8. 分级报告:需立即处理(崩溃 / OOM)/ 需关注(高频 ERROR)/ 可忽略(常规 WARN)

详细参考

  • 日志路径清单 + Windows/Linux 命令模板 + 时间窗口语法 + 报告结构:{skill_dir}/references/log-commands.md
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. 7d ago First seen · 51 lines · 39 tokens per session scan A 5c6b9146de82

Subscribe to this mod's changes

log-analyzer is a skill published in the GitHub repository ntygod/ZhiWei (137 stars, last pushed 26d ago), licensed MIT. It adds 39 tokens to every session and 662 once invoked, about $0.0002 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.