spike-trap

spike-trap is a skill for Claude Code from piti6/SpikeTrap. It costs 62 tokens per session (1,296 once invoked), scanned A, original, MIT.

A Unity game profiling workflow that uses SpikeTrap to collect CPU performance data and find frames where the game slows down.

In plain words
What is it for?
Capturing spike frames during play mode, analyzing cached profiler data, applying CPU or garbage-collection thresholds, and saving matched frames as .data files.
Why use it?
It helps locate performance bottlenecks by recording unusually slow frames and examining profiler data.

Skill for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Capturing spike frames during play mode, analyzing cached profiler data, applying CPU or garbage-collection thresholds, and saving matched frames as .data files.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/piti6/spiketrap/spike-trap
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 piti6/SpikeTrap --skill spike-trap
Clone the repo
git clone --depth 1 https://github.com/piti6/SpikeTrap

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 spike-trap

README.md
[![agentmods](https://agentmods.dev/badge/skills/piti6/spiketrap/spike-trap/github.svg)](https://agentmods.dev/skills/piti6/spiketrap/spike-trap)
Your own site
<a href="https://agentmods.dev/skills/piti6/spiketrap/spike-trap"><img src="https://agentmods.dev/badge/skills/piti6/spiketrap/spike-trap/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 spike-trap

Your own site · 80×15
<a href="https://agentmods.dev/skills/piti6/spiketrap/spike-trap"><img src="https://agentmods.dev/badge/skills/piti6/spiketrap/spike-trap.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,296 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.00062 $0.01296
Opus 5 $0.00031 $0.00648
Sonnet 5 $0.00012 $0.00259
Haiku 4.5 $0.00006 $0.00130

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

Security

Grade A, and why

spike-trap 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 9d 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.

Packages/com.piti6.spike-trap/.claude/skills/spike-trap/SKILL.md · 120 lines

How it starts

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

SpikeTrap Profiling Skill

Run an automated CPU profiling session using SpikeTrap. $ARGUMENTS

Modes

Determine which mode to use based on the user's request:

  • profile (default): Enter play mode, collect spike frames, stop, analyze, and report.
  • analyze: Skip profiling — analyze already-cached data or a loaded .data file.

If the user provides a spike threshold (e.g. "33ms", "16.6ms"), use it. Default: 33ms. If the user provides a GC threshold (e.g. "100KB"), use it. Default: 0 (disabled). If the user provides a duration (e.g. "10 seconds"), wait that long before stopping. Default: 10 seconds.

Profile Workflow

Step 1: Check prerequisites

using SpikeTrap.Editor;
return $"ViewActive={SpikeTrapApi.IsViewActive}, Collecting={SpikeTrapApi.IsCollecting}, Cached={SpikeTrapApi.CachedFrameCount}";

If IsViewActive is false, tell the user to open the Profiler window and select the SpikeTrap CPU module, then stop.

Step 2: Enter play mode

Use mcp__uLoopMCP__control-play-mode with Action=Play. Wait for Unity to be ready.

Step 3: Enable profiler and start collecting

using UnityEditorInternal;
using SpikeTrap.Editor;
ProfilerDriver.enabled = true;
SpikeTrapApi.StartCollecting(spikeThresholdMs: <THRESHOLD>f, gcThresholdKB: <GC_THRESHOLD>f);
return $"Collecting: spike>{<THRESHOLD>}ms, gc>{<GC_THRESHOLD>}KB";

Step 4: Wait for the requested duration

Tell the user profiling is running. Use ScheduleWakeup or repeated checks to wait.

Step 5: Stop and save

using SpikeTrap.Editor;
string path = System.IO.Path.Combine(UnityEngine.Application.dataPath, "..", "spike-trap-capture.data");
bool saved = await SpikeTrapApi.StopCollectingAndSaveAsync(path);
return $"Saved={saved}, Path={path}";

Then stop play mode with mcp__uLoopMCP__control-play-mode Action=Stop.

Step 6: Analyze (same as Analyze Workflow below)

Analyze Workflow

Step 1: Get spike frames

using SpikeTrap.Editor;
var spikes = SpikeTrapApi.GetSpikeFrames(<THRESHOLD>f);
if (spikes == null || spikes.Length == 0) return "No spike frames found.";
var sb = new System.Text.StringBuilder();
sb.AppendLine($"Found {spikes.Length} spike frames (>{<THRESHOLD>}ms):");
for (int i = 0; i < System.Math.Min(20, spikes.Length); i++)
    sb.AppendLine(spikes[i].ToString());
return sb.ToString();

Read the full file on GitHub · 120 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. 9d ago First seen · 120 lines · 62 tokens per session scan A 53eed93d70a3

Subscribe to this mod's changes

spike-trap is a skill published in the GitHub repository piti6/SpikeTrap (22 stars, last pushed 4mo ago), licensed MIT. It adds 62 tokens to every session and 1,296 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-30.

Related

Other skills, from other repositories

profiling

Diagnose frame-rate bottlenecks (CPU vs GPU bound FIRST), control Unreal Insights traces, sample live frame times, and annotate performance captures. Use when FPS is low/bad, the game is slow, or you need to find what is limiting the frame rate.

kevinpbuckley/VibeUE · 57 tokens

performance

Performance optimization patterns covering Core Web Vitals, React render optimization, lazy loading, image optimization, backend profiling, LLM inference, and sustainability UX. Use when improving page speed, debugging slow renders, optimizing bundles, reducing image payload, profiling backend, deploying LLMs…

yonatangross/orchestkit · 64 tokens

performance

Use when a page or interaction is slow for one user and the fix starts from a measurement — a failing Core Web Vital (LCP, INP, CLS), a heavy JS bundle, wasted re-renders, an over-broad client boundary: profile, attribute the cost to one phase, fix it, re-measure. NOT surviving concurrent load (that is scaling), NOT…

ericrisco/rsc-harness · 91 tokens

tune-performance

Use when the user reports the game is slow, drops framerate, stutters, takes forever to start, or runs poorly on specific hardware. Profiles the running game via summergetdiagnostics, identifies hotspots (rendering / physics / scripting), and proposes specific fixes with before/after metric expectations. Trigger on…

SummerEngine/summer-engine-agent · 94 tokens

performance-expert

Expert-level performance optimization, profiling, benchmarking, and tuning. Use when the user mentions optimization, profiling, benchmarking, or scalability, or when the task involves Performance Fundamentals, Optimization Areas, Profiling Tools, or General.

personamanagmentlayer/pcl · 48 tokens

performance-optimization

Use when performance requirements exist, profiling reveals bottlenecks, or Core Web Vitals need improvement. Do NOT use without evidence — premature optimization adds complexity.

juanmhidalgo/claude-plugins · 35 tokens