investigate-puffin
Ce qu’il fait
Cette compétence permet à votre IA d'ouvrir un enregistrement du profileur Puffin et de trouver les parties d'une application qui prennent le plus de temps. Elle s'adresse aux développeurs qui veulent vérifier les performances avant et après une modification.
Quand l’utiliser
- ✓Quand vous avez un fichier .puffin et voulez savoir quel code est lent.
- ✓Lorsque vous voulez comparer une trace prise avant un changement avec une trace prise après.
- ✓Lorsque vous demandez à votre IA d'utiliser la commande rerun dump-puffin pour lire un profil.
Lien du skill
https://github.com/rerun-io/rerun/blob/main/skills/investigate-puffin/SKILL.mdCopiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.
Comment l’utiliser
Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.
Message prêt à coller
Pour Claude Code, Codex ou Cursor : lancez-la dans le dossier du projet et le skill est installé.
Téléchargez le SKILL.md et placez-le dans le dossier de skills de votre agent.
Exemple de demande à votre IA
“Regarde cet enregistrement .puffin et dis-moi quelles fonctions prennent le plus de temps.”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
La compétence convertit l'enregistrement en JSON avec la commande rerun dump-puffin, puis utilise de petits scripts d'aide pour trouver les portées les plus lentes et comparer deux exécutions.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis GitHub.
Investigate puffin traces
Analyze a .puffin recording from an application instrumented with Puffin.
Use the recording path supplied by the user. Or use the capture_profile_trace message if using the rerun MCP.
Setup
Requires the rerun CLI (Rerun 0.38 or later), Python 3.10 or later, and jq.
The Python helpers use only the standard library.
Set PUFFIN_SKILL_DIR to the absolute directory containing this SKILL.md.
In Claude Code, you can use export PUFFIN_SKILL_DIR="${CLAUDE_SKILL_DIR}"; in other agents, resolve the directory from the installed skill location.
Dump the trace to a file and check scope registration:
rerun dump-puffin <path> > /tmp/puffin.json
jq '.scopes | length' /tmp/puffin.json
If no (recent enough) rerun binary is on the path but you are in a Rerun checkout, run the sub-command from source instead:
cargo run --quiet -p rerun-cli --no-default-features -- dump-puffin <path> > /tmp/puffin.json
Always dump to a file.
.puffin traces can produce many MB of JSON, so query the saved JSON instead of reading it all into context.
If .scopes | length is 0, names fall back to scope#<id> and source locations are missing.
Ask for a new capture that includes scope registration if names are needed for the investigation.
If another capture is not feasible, proceed with dynamic data labels and explain the limits.
Check the registration table after exporting: do not assume that every capture tool or version preserves it.
How traces are captured
Use the application's Puffin capture or export support to save a .puffin file.
For applications serving profiling data through puffin_http, connect a compatible puffin_viewer and export the recording.
The dumper uses Puffin 0.20; captures from incompatible format versions may require a matching parser.
Rerun-specific examples:
- Native viewer / CLI: enable the built-in Puffin server from the UI.
- Python SDK: set
RERUN_PUFFIN=1before importingrerunto stream profiling data topuffin_viewer. - Rust binaries using
re_tracing: keep are_tracing::Profileralive for the capture and call itsstart()method with server support enabled. It starts a server and attempts to launchpuffin_viewer.
Investigate with jq
The JSON layout:
{
"file": "preview.puffin",
"scopes": { "<id>": { name, function, file, line, kind } }, # may be empty — see Setup
"frames": [
{
"frame_index": …,
"range_ns": [start, end],
"duration_ns": …,
"num_scopes": …,
"threads": [
{
"name": "main",
"num_scopes": …, "depth": …, "range_ns": […],
"scopes": [ { id, name, start_ns, duration_ns, data, children: […] } ]
}
]
}
]
}
name on each scope is resolved from the scopes map.
data is the dynamic per-call string, such as an event type or a mesh name.
Recipes
Footgun: any .. | objects | select(.name? == …) pattern MUST also select(has("duration_ns")).
.. walks every object in the tree, including entries in the top-level scopes registration map, which have .name but no .duration_ns.
Without the guard you will hit null / 1e6 errors or sort against null.
Every recipe below includes the guard, keep it when adapting them.
Prefer find_scopes.py for name/data lookups. If you just want "slowest matches of X", "total time grouped by name" or "all scopes matching X on thread Y", reach for find_scopes.py instead of writing jq, it's shorter and bakes the guard in.
See "Looking for a scope by prefix" below.
Use the jq recipes here when you need something the script does not cover (children of a specific scope, cross-thread windows, time-ordered traversal).
# overall shape — sorted slowest first so the bad frames jump out
jq '.frames | map({i: .frame_index, ms: (.duration_ns / 1e6), scopes: .num_scopes}) | sort_by(-.ms)' /tmp/puffin.json
# per-thread totals for the slowest frame
jq '.frames | sort_by(-.duration_ns) | .[0].threads | map({name, num_scopes, depth, ms: ((.range_ns[1] - .range_ns[0]) / 1e6)})' /tmp/puffin.json
# top 10 slowest individual scopes (recursive descent over the whole tree)
# also doable as: find_scopes.py /tmp/puffin.json '' --top 10
jq '[.. | objects | select(has("duration_ns") and has("name"))]
| sort_by(-.duration_ns) | .[0:10]
| map({name, data, ms: (.duration_ns / 1e6)})' /tmp/puffin.json
# total time per scope name (best-effort: group
Questions fréquentes
De quoi ai-je besoin pour l'installer ?
La compétence nécessite l'outil en ligne de commande rerun en version 0.38 ou plus récente, Python 3.10 ou plus récent, et jq.
Pourquoi la trace est-elle enregistrée dans un fichier ?
Les traces Puffin peuvent peser plusieurs mégaoctets. La compétence interroge donc le JSON enregistré au lieu de tout lire.
Que faire si les noms ressemblent à scope# ?
Cela signifie que l'enregistrement ne contient pas de noms de portées. La compétence demande alors une nouvelle capture incluant ces noms.
Détails
Description originale de l’auteur
Investigate Puffin profiler recordings (.puffin files), find slow scopes, and compare before/after traces using the `rerun dump-puffin` command and bundled analysis helpers.
repo: rerun-io/rerun
Popularité
- Étoiles GitHub
- 12k
- Position au classement
- #11547
- Licence
- Apache-2.0
- Mis à jour
- 02/11/2026
Commentaires
- …
Autres skills de ce dépôt
rerun-blueprint
12kApprend à votre agent à modifier l'affichage du visualiseur Rerun avec un blueprint : mise en page, vues et colonnes masquées.
rerun-catalog-queries
12kAide votre agent à interroger plus vite un catalogue Rerun depuis Python, avec des conseils sur les allers-retours, la taille des données et les lectures lentes.
rerun-chunk-processing
12kApprend à votre agent à créer des pipelines Rerun avec des lecteurs et des lentilles, pour convertir des fichiers MCAP, Parquet, vidéo ou RRD.
rerun-data-model
12kAide votre agent à organiser des données de robot ou multimodales dans le modèle de Rerun : entités, composants et valeurs statiques ou temporelles.
Skills similaires
diffs
394kPermet à votre agent de produire un diff réel et partageable de vos modifications, sous forme de lien ou d'image, plutôt qu'un résumé écrit à la main.
coding-agent
394kAide votre agent à confier une tâche de programmation plus importante à Codex, Claude Code ou OpenCode comme travailleur en arrière-plan, puis à suivre sa progression.
gh-issues
394kAide votre agent à trouver des tickets GitHub, choisir ceux à traiter et ouvrir des pull requests avec des correctifs, y compris le suivi des commentaires de relecture.