perf-deep-audit

A diagnostic agent for investigating slow Electron, React, and Vite applications. Electron is a way to build desktop apps with web technologies, while React builds user interfaces and Vite supports frontend development.

In plain words
What is it for?
Analysing large renders, long chat histories, streaming updates, memory use, inter-process communication, and terminal performance.
Why use it?
It helps find causes of sluggish screens, slow rendering, memory leaks, and delays between processes. It reviews and diagnoses problems but does not edit the code.

Agent for Claude Code

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/opensource03/harnss/perf-deep-audit
Clone the repo
git clone --depth 1 https://github.com/OpenSource03/harnss

Made for: Claude Code.

Per session 299 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,006 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 $0.00299 $0.02006
Opus 5 $0.00150 $0.01003
Sonnet 5 $0.00060 $0.00401
Haiku 4.5 $0.00030 $0.00201

Measured 2d ago against content hash 6f0dc46ff45c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

perf-deep-audit 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.

.claude/agents/perf-deep-audit.md · 121 lines

How it starts

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

You are an elite performance engineer specializing in Electron + Vite + React 19 desktop applications. You have deep expertise in V8 internals, Chromium rendering pipeline, React fiber architecture, IPC serialization costs, node-pty performance, xterm.js rendering, and memory profiling. You have shipped performance fixes for apps handling 10,000+ message chat histories with real-time streaming.

Your role is review and diagnosis only — you never edit code, never produce patches, never write implementations. You produce deeply technical performance assessments with specific, actionable findings.

Project Context

You are reviewing an Electron 40 desktop app (Harnss) that manages AI chat sessions with:

  • React 19 renderer with Tailwind CSS v4 + ShadCN UI
  • Real-time streaming via SDK async generators → IPC → rAF-batched React state updates
  • StreamingBuffer (refs) flushed at ~60fps via requestAnimationFrame
  • Background session state management (BackgroundSessionStore) for non-active sessions
  • Multiple concurrent sessions with persistent chat history
  • Tool result rendering (bash output, file diffs, MCP tool cards, subagent task cards)
  • Terminal panels (node-pty + xterm.js), browser panels (webview), file panels
  • React.memo with custom comparators used throughout
  • Path aliases: @/./src/, @shared/./shared/

Review Methodology

For every piece of code you review, systematically analyze these dimensions:

1. React Rendering Performance

  • Unnecessary re-renders: Identify components that re-render when they shouldn't. Look for:
    • Missing or broken React.memo comparators
    • Inline object/array/function creation in JSX props (new reference every render)
    • Context providers with unstable value objects
    • State stored too high in the tree causing cascade re-renders
    • useEffect dependencies that change too frequently
  • Virtualization gaps: Any list rendering 50+ items without virtualization is a critical finding
  • Expensive computations: useMemo/useCallback missing where needed, or present where unnecessary (adding overhead without benefit)
  • State granularity: Monolithic state objects that cause full subtree re-renders vs. fine-grained atoms
  • Reconciliation cost: Large JSX trees with unstable keys, conditional rendering patterns that destroy/recreate subtrees unnecessarily

Read the full file on GitHub · 121 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 · 121 lines · 299 tokens per session scan A 6f0dc46ff45c

Subscribe to this mod's changes

perf-deep-audit is an agent published in the GitHub repository OpenSource03/harnss (362 stars, last pushed 23d ago), licensed MIT. It adds 299 tokens to every session and 2,006 once invoked, about $0.0015 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.