perf

perf is a command for Claude Code from eddiesanjuan/markupr. It costs 0 tokens per session (1,516 once invoked), scanned A, original, MIT.

A command for reviewing the performance of Markupr, an application that runs as a desktop app, command-line tool, and MCP server. It examines build sizes, dependencies, and code patterns that may slow the software down.

In plain words
What is it for?
Measuring build outputs, finding large files and dependencies, checking production source maps, and recommending ways to reduce performance bottlenecks.
Why use it?
It helps locate what makes each version slow or unnecessarily large, so improvements can be ranked by likely impact.

Command 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 commands/eddiesanjuan/markupr/perf
Clone the repo
git clone --depth 1 https://github.com/eddiesanjuan/markupr

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 perf

README.md
[![agentmods](https://agentmods.dev/badge/commands/eddiesanjuan/markupr/perf.svg)](https://agentmods.dev/commands/eddiesanjuan/markupr/perf)
Your own site
<a href="https://agentmods.dev/commands/eddiesanjuan/markupr/perf"><img src="https://agentmods.dev/badge/commands/eddiesanjuan/markupr/perf.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 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,516 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.00000 $0.01516
Opus 5 $0.00000 $0.00758
Sonnet 5 $0.00000 $0.00303
Haiku 4.5 $0.00000 $0.00152

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

Security

Grade A, and why

perf 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 5d 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/commands/perf.md · 140 lines

How it starts

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

Perf -- Performance Optimization Audit

Analyze markupr's performance characteristics across its three runtimes: Electron desktop app, CLI tool, and MCP server. Identify bottlenecks, heavy dependencies, and anti-patterns with prioritized recommendations.

Instructions

1. Bundle Size Analysis

Build all targets and measure output sizes:

cd ~/Projects/markupr && npm run build 2>&1

# Measure each build output
du -sh dist/main/
du -sh dist/renderer/
du -sh dist/cli/
du -sh dist/mcp/
du -sh dist/preload/

# Find the largest individual files
find dist/ -type f -name "*.mjs" -o -name "*.js" -o -name "*.css" | xargs ls -lhS | head -20

Report the size of each build target. For the renderer bundle specifically, check if source maps are included in production (they should not be).

2. Dependency Weight Analysis

Assess the heaviest dependencies and whether lighter alternatives exist:

Dependency Purpose Risk Area
sharp Image optimization for AI pipeline (src/main/ai/ImageOptimizer.ts) Native module, large binary (~30MB). Check if it's tree-shaken or fully bundled. For CLI/MCP, could canvas or jimp be lighter?
@anthropic-ai/sdk Claude API calls (src/main/ai/ClaudeAnalyzer.ts) Large SDK. Check if markupr uses enough of it to justify full import vs. raw fetch
electron-store Settings persistence (src/main/settings/) Pulls in conf, atomically, etc. Check if electron's built-in safeStorage + JSON would suffice
whisper-node Local transcription (src/main/transcription/WhisperService.ts) Native module with binary download. Check startup impact
keytar Secure API key storage (src/main/settings/) Native module. Check if Electron safeStorage could replace it
zod Schema validation (src/shared/) Check v4 bundle size. v4 is significantly larger than v3

For each dependency:

  • Read the actual import sites to see how much of the package is used
  • Check if it's properly externalized in electron.vite.config.ts (main process deps should be external)
  • Check if CLI/MCP builds in scripts/build-cli.mjs and scripts/build-mcp.mjs properly externalize or bundle

Read the full file on GitHub · 140 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. 5d ago First seen · 140 lines · 0 tokens per session scan A ed0176d5587f

Subscribe to this mod's changes

perf is a command published in the GitHub repository eddiesanjuan/markupr (18 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,516 tokens. 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.