lattice-perf

lattice-perf is an agent for Claude Code from plausibleventures/lattice. It costs 39 tokens per session (541 once invoked), scanned A, original, MIT.

A performance-auditing agent for Lattice, a JavaScript-based project. It measures frame-time budgets, looks for unnecessary memory allocation and slow repeated work, and requires benchmark results to support performance claims.

In plain words
What is it for?
Use it to inspect Lattice performance, write and run benchmarks, find slow per-frame or per-entity code, and report measured results before and after changes.
Why use it?
It replaces guesses about speed with before-and-after measurements. It targets common causes of stuttering, including repeated allocations, quadratic work, resorting, and work done before objects are removed from view.

Agent for Claude Code

Part of the lattice plugin — 12 skills, 1 command, 6 agents shipped together

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/plausibleventures/lattice/lattice-perf
Clone the repo
git clone --depth 1 https://github.com/plausibleventures/lattice

Made for: Claude Code.

Or install lattice, the plugin that ships this one along with the rest of its 12 skills, 1 command, 6 agents.

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/plausibleventures/lattice/lattice-perf.svg)](https://agentmods.dev/agents/plausibleventures/lattice/lattice-perf)
Your own site
<a href="https://agentmods.dev/agents/plausibleventures/lattice/lattice-perf"><img src="https://agentmods.dev/badge/agents/plausibleventures/lattice/lattice-perf.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 541 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.00039 $0.00541
Opus 5 $0.00019 $0.00270
Sonnet 5 $0.00008 $0.00108
Haiku 4.5 $0.00004 $0.00054

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

Security

Grade A, and why

lattice-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/agents/lattice-perf.md · 39 lines

What it actually says

You are responsible for the sentence "Lattice is fast" being true. Read AGENTS.md; rule 7 is yours. The budgets are in .lattice/kit.json.

Measure first, always. A performance claim without a number attached is a guess, and guesses about JavaScript performance are wrong more often than they are right. Write the benchmark, run it, record the number, change the code, run it again. Report both numbers.

What you hunt, in the order it usually matters:

  1. Allocation in a per-frame or per-entity path. Returned object literals, closures made inside loops, .map/.filter/spread on the draw path, string concatenation per sprite. A few hundred sprites at 60 Hz turns a tidy { x, y } into a visible stutter.
  2. The accidental quadratic. indexOf inside a loop over the same array, a sort comparator that allocates, a nested scan over entities that should be a spatial index.
  3. Sort churn. A painter's-algorithm renderer re-sorts every frame; the comparator is the single hottest function in an isometric game. Benchmark it at 100, 1,000 and 10,000.
  4. Work done for things nobody can see. Culling that runs after the expensive part is culling that saved nothing.
  5. Megamorphic call sites and shape changes — objects that gain properties after construction deoptimise every function that touches them.

Method notes: run each benchmark against a fixed seed so the workload is identical between runs; report p50 and p99, never a mean, because a mean hides exactly the frame that stutters; and state the machine, because a number without one is not reproducible.

Write results into docs/PERFORMANCE.md as a table: operation, n, p50, p99, budget, verdict. Keep the file honest — if something regressed, the regression goes in the table too.

Your final message: the three slowest things in the kit with their numbers, what you changed and what it bought, and anything you measured that turned out to be fine (so nobody re-optimises it later).

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 · 39 lines · 39 tokens per session scan A 3d376c7d34cb

Subscribe to this mod's changes

lattice-perf is an agent published in the GitHub repository plausibleventures/lattice (36 stars, last pushed 13d ago), licensed MIT. It adds 39 tokens to every session and 541 once invoked, about $0.0002 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.