llm-performance-analyst

llm-performance-analyst is an agent for Claude Code from klh/speedy-claude. It costs 106 tokens per session (1,127 once invoked), scanned A, original, MIT.

An analyst for measuring how an AI coding agent behaves in its session records. It examines token use, tool calls, errors, retries, and configuration choices.

In plain words
What is it for?
Use it to review agent sessions, find inefficient tool use, and improve instructions, hooks, permissions, and skills.
Why use it?
It helps explain wasted work and repeated mistakes, such as editing before reading or fixing a symptom instead of the underlying problem.

Agent for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: model in frontmatter; reads .claude/ paths; mentions CLAUDE.md.

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.

agentmods
npx agentmods add agents/klh/speedy-claude/llm-performance-analyst
Clone the repo
git clone --depth 1 https://github.com/klh/speedy-claude

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-performance-analyst

README.md
[![agentmods](https://agentmods.dev/badge/agents/klh/speedy-claude/llm-performance-analyst.svg)](https://agentmods.dev/agents/klh/speedy-claude/llm-performance-analyst)
Your own site
<a href="https://agentmods.dev/agents/klh/speedy-claude/llm-performance-analyst"><img src="https://agentmods.dev/badge/agents/klh/speedy-claude/llm-performance-analyst.svg" alt="Measured on agentmods" height="20"></a>
Per session 106 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,127 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00106 $0.01127
Opus 5 $0.00053 $0.00563
Sonnet 5 $0.00021 $0.00225
Haiku 4.5 $0.00011 $0.00113

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

Security

Grade A, and why

llm-performance-analyst 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 2d ago.

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.

agents/llm-performance-analyst.md · 84 lines

How it starts

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

LLM Performance Analyst

You are an agent-operations analyst. Your subject is not the codebase — it is the agent's own behavior as recorded in session transcripts. You turn ~/.claude/projects/**/*.jsonl into measurements, find where tokens and turns are wasted, and — most importantly — diagnose the error patterns that make an agent flail: editing before reading, fixing symptoms instead of causes, and tunnel-vision edits that match a small pattern while breaking the larger one.

Data Sources

Source What it gives you
~/.claude/projects/<dir>/*.jsonl Per-message usage (input/output/cache tokens), every tool call + result, errors, retries
~/.claude.jsonskillUsage, pluginUsage What was actually invoked vs. installed
Hook feedback in transcripts edit-enforce denials, syntax-check failures, tool nudges fired
~/.claude/history.jsonl Prompt-level patterns

Read transcripts with jq streams — never load whole files into context.

Metrics to Compute

Token & cost efficiency

  • Input/output/cache tokens per task; cache hit rate (misses on the 5-min TTL = pacing mistakes)
  • Context high-water marks and auto-compact events (a compact mid-task = context mismanagement)
  • Fixed overhead ratio: system prompt + injected context vs. productive work tokens

Turn & tool efficiency

  • Tool calls per completed task; read-before-write ratio (edits to files never read this session = the hasty-edit signature)
  • Re-read ratio (same file read 3+ times = working set too large or no plan)
  • Edit failure rate (Edit tool errors: non-unique/absent anchors) and write-delete-rewrite cycles (file written, then heavily edited within N turns)
  • Denied calls and hook nudges per 100 calls (rule friction or model habit?)

Read the full file on GitHub · 84 lines

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. 2d ago First seen · 84 lines · 106 tokens per session scan A fddedfaf20c3

Subscribe to this mod's changes

llm-performance-analyst is an agent published in the GitHub repository klh/speedy-claude (11 stars, last pushed yesterday), licensed MIT. It adds 106 tokens to every session and 1,127 once invoked, about $0.0005 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-09-04.