perf-diagnose

perf-diagnose is a skill for Claude Code, Codex from chipi/agentic-ai-homelab. It costs 106 tokens per session (1,228 once invoked), scanned A, original, MIT.

A measured investigation for a slow or stuck web endpoint or job. It starts with recorded logs, errors, and traces, reproduces the problem locally, and compares the old and changed code.

In plain words
What is it for?
Use it to investigate hanging requests, background-job interference, locks, and Python thread CPU contention.
Why use it?
It replaces guesses about the cause of a slowdown with evidence and a before-and-after check.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths.

Good fit Use it to investigate hanging requests, background-job interference, locks, and Python thread CPU contention.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chipi/agentic-ai-homelab/perf-diagnose
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 chipi/agentic-ai-homelab --skill perf-diagnose
Clone the repo
git clone --depth 1 https://github.com/chipi/agentic-ai-homelab

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 perf-diagnose

README.md
[![agentmods](https://agentmods.dev/badge/skills/chipi/agentic-ai-homelab/perf-diagnose/github.svg)](https://agentmods.dev/skills/chipi/agentic-ai-homelab/perf-diagnose)
Your own site
<a href="https://agentmods.dev/skills/chipi/agentic-ai-homelab/perf-diagnose"><img src="https://agentmods.dev/badge/skills/chipi/agentic-ai-homelab/perf-diagnose/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for perf-diagnose

Your own site · 80×15
<a href="https://agentmods.dev/skills/chipi/agentic-ai-homelab/perf-diagnose"><img src="https://agentmods.dev/badge/skills/chipi/agentic-ai-homelab/perf-diagnose.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 106 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,228 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.00106 $0.01228
Opus 5.5 $0.00042 $0.00491
Sonnet 5.5 $0.00021 $0.00246
Haiku 4.5 $0.00011 $0.00123

Measured 17d ago against content hash bdd791fec3a1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

perf-diagnose 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 17d ago.

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

workstation/claude/skills/perf-diagnose/SKILL.md · 85 lines

How it starts

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

perf-diagnose

A stall has a cause you can measure. This is the order that found one fast (podcast_scraper, 2026-10-16), written down so the next one does not start from scratch. The ladder ends where replay-proven-fix begins.

1. Read what production already recorded (no SSH yet)

  • Load o11y-review for the window: logs, errors and traces around the stall.
  • Look for: the exact request that did not answer (an access-log line missing is itself the signal), what else was running then (warmers, migrations, backfills), and per-step timings if the service logs them.
  • Write down what is known and what is not, before forming a theory (rule: never invent root causes).

2. Name the candidate mechanism

Symptom Usual mechanism How to tell
A request that is fast alone does not answer while a background job runs, then answers in seconds GIL starvation: a CPU-bound thread in the same Python process; a syscall-heavy request gives up the GIL on every call and queues to get it back step 3 bench
Every request waits the same long time, then all answer together a lock or single-flight around a cold build grep for locks / single_flight on the path; time with the job off
Only under many concurrent requests worker pool or connection pool exhausted count workers; the access log's concurrency
Box-wide slowness, every process CPU or memory saturation (other agents' runs, an OOM loop) uptime, ps aux | sort -nrk3 | head

3. Reproduce locally

For GIL starvation, the bench times a probe (what the request does) idle, under the suspected load in-process, and with the load in a child process:

python3 ~/.claude/skills/perf-diagnose/scripts/contention_bench.py --demo   # see the effect
<project>/.venv/bin/python ~/.claude/skills/perf-diagnose/scripts/contention_bench.py \
  --path <repo>/src --probe pkg.mod:walk_like_the_request --load pkg.mod:score_like_the_warmer

Both functions take no arguments; write two small wrappers in the scratchpad if needed.

Read the full file on GitHub · 85 lines

Files

What ships with it

1 file 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. 17d ago First seen · 85 lines · 106 tokens per session scan A bdd791fec3a1

Subscribe to this mod's changes

perf-diagnose is a skill published in the GitHub repository chipi/agentic-ai-homelab (3 stars, last pushed today), licensed MIT. It adds 106 tokens to every session and 1,228 once invoked, about $0.0004 per session on Opus 5.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-10-18.

Related

Other skills, from other repositories

error-handling-patterns

Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.

wshobson/agents · 43 tokens

data-fetching

Use when implementing or debugging ANY network request, API call, or data fetching. Covers fetch API, axios, React Query, SWR, error handling, caching strategies, offline support.

Intelligent-Internet/ii-agent · 41 tokens

spine-perf

Find and fix performance bottlenecks — N+1 queries, missing indexes, sync bottlenecks, caching gaps. Use when asked "why is this slow", "performance issue", "optimize this endpoint", or "N+1 queries".

tonone-ai/tonone · 55 tokens

spine-recon

Backend reconnaissance — map all routes, middleware, models, dependencies, auth, and assess code quality for project takeover. Use when asked to "understand this backend", "map the API", or "assess code quality".

tonone-ai/tonone · 50 tokens

verifying-external-behavior

Confirms what a third-party library, remote API, build backend, or scraped document actually does before writing code that depends on it — throwaway probes that run in seconds, permissive clients that forward wrong arguments instead of rejecting them, per-endpoint docs that don't generalize, response shapes that make…

AleksandarBisevac/claude-plugins · 138 tokens

dev-error-handling

Error handling strategy. Trigger when the user wants to implement error handling, exceptions, or error boundaries.

christopherlouet/claude-base · 25 tokens