perf-monitor

perf-monitor is an agent for Claude Code from kensaurus/cursor-kenji. It costs 52 tokens per session (720 once invoked), scanned A, original, MIT.

A performance review that checks code changes for effects on speed and bundle size, which is the amount of code sent to users. It is triggered by requests or changes involving areas such as slow screens, loading, rendering, data fetching, and assets.

In plain words
What is it for?
Useful for checking dependencies, component re-renders, image loading, server and client data fetching, caching, pagination, code splitting, and other speed-related patterns.
Why use it?
It helps catch changes that make an app slower, increase downloads, or do unnecessary work in the browser. It focuses the review on likely performance risks.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cursor-kenji plugin — 123 skills, 56 commands, 6 agents, 3 MCP servers shipped together

Good fit Useful for checking dependencies, component re-renders, image loading, server and client data fetching, caching, pagination, code splitting, and other speed-related patterns.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/kensaurus/cursor-kenji/perf-monitor
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.

Clone the repo
git clone --depth 1 https://github.com/kensaurus/cursor-kenji

Made for: Claude Code.

Or install cursor-kenji, the plugin that ships this one along with the rest of its 123 skills, 56 commands, 6 agents, 3 MCP servers.

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-monitor

README.md
[![agentmods](https://agentmods.dev/badge/agents/kensaurus/cursor-kenji/perf-monitor/github.svg)](https://agentmods.dev/agents/kensaurus/cursor-kenji/perf-monitor)
Your own site
<a href="https://agentmods.dev/agents/kensaurus/cursor-kenji/perf-monitor"><img src="https://agentmods.dev/badge/agents/kensaurus/cursor-kenji/perf-monitor/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-monitor

Your own site · 80×15
<a href="https://agentmods.dev/agents/kensaurus/cursor-kenji/perf-monitor"><img src="https://agentmods.dev/badge/agents/kensaurus/cursor-kenji/perf-monitor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 720 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.00052 $0.00720
Opus 5 $0.00026 $0.00360
Sonnet 5 $0.00010 $0.00144
Haiku 4.5 $0.00005 $0.00072

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

Security

Grade A, and why

perf-monitor 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 11d 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/perf-monitor.md · 75 lines

How it starts

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

When Invoked

  1. Identify what changed (git diff)
  2. Assess performance impact
  3. Suggest optimizations if needed

Quick Performance Checks

Bundle Impact

# Check if new dependencies were added
git diff package.json | grep "+"
# Estimate impact
npx bundlephobia [new-package-name]

Component Render Performance

  • Is the component using 'use client' when it could be a Server Component?
  • Are there unnecessary re-renders? (objects/arrays in deps, missing memoization)
  • Are lists virtualized if > 50 items?
  • Are images using next/image with proper sizes?

Data Fetching

  • Is data fetched at the right level? (server vs client)
  • Is there N+1 querying? (check include/select usage)
  • Are queries paginated for large datasets?
  • Is caching configured? (revalidate, TanStack Query staleTime)

Asset Performance

  • Images: WebP/AVIF format, proper dimensions, lazy loading
  • Fonts: font-display: swap, preloaded, subset if possible
  • CSS: No unused styles, animations use transform/opacity only
  • JS: Code-split heavy components with dynamic() or React.lazy()

Red Flags

Pattern Impact Fix
'use client' at page level Disables SSR Move to leaf components
useEffect + fetch No SSR, loading flash Server Component or prefetch
Inline objects in JSX Re-renders children useMemo or extract
Large node_modules import Bundle bloat Tree-shake or lazy load
Unoptimized images Slow LCP next/image with sizes
LCP > 2.5s but image is small loading="lazy" on hero / not preloaded remove lazy, fetchpriority="high", <Image priority>
Fast first page, slow second page no prefetch/prerender Speculation Rules prefetch moderate → enhance-web-instant-nav
Back button reloads the page bfcache blocked (unload, no-store) pagehide, drop no-store on HTML
INP > 200ms on click long task in handler / hydration scheduler.yield(), React Compiler, split handler
No pagination Memory/network Add cursor pagination
SELECT * Over-fetching Select specific fields

Read the full file on GitHub · 75 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. 11d ago First seen · 75 lines · 52 tokens per session scan A 46db4580e1e3

Subscribe to this mod's changes

perf-monitor is an agent published in the GitHub repository kensaurus/cursor-kenji (9 stars, last pushed yesterday), licensed MIT. It adds 52 tokens to every session and 720 once invoked, about $0.0003 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-31.