flamegraphs

flamegraphs is a skill for Claude Code, Codex from mohitmishra786/low-level-dev-skills. It costs 81 tokens per session (1,309 once invoked), scanned A, original, MIT.

A guide to turning profiler recordings into flamegraphs, which are visual charts showing how much time a program spends in each function.

In plain words
What is it for?
Use it with data from perf, Valgrind Callgrind, or other profilers to create, read, and compare SVG flamegraphs.
Why use it?
It makes CPU bottlenecks easier to spot and helps compare performance before and after a change.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it with data from perf, Valgrind Callgrind, or other profilers to create, read, and compare SVG flamegraphs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mohitmishra786/low-level-dev-skills/flamegraphs
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 mohitmishra786/low-level-dev-skills --skill flamegraphs
Clone the repo
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills

Made for: Claude Code, Codex.

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 flamegraphs

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/flamegraphs"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/flamegraphs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,309 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. Third-party audits
  • Socket pass 15 Sept 2026
  • Snyk pass 15 Sept 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00081 $0.01309
Opus 5.5 $0.00032 $0.00524
Sonnet 5.5 $0.00016 $0.00262
Haiku 4.5 $0.00008 $0.00131

Measured 14d ago against content hash 3c6fecf43e19, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

flamegraphs 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 14d 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.

skills/profilers/flamegraphs/SKILL.md · 158 lines

How it starts

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

Flamegraphs

Purpose

Guide agents through the pipeline from profiler data to SVG flamegraph, and teach interpretation of flamegraphs to drive concrete optimisation decisions.

Triggers

  • "How do I generate a flamegraph from perf data?"
  • "How do I read a flamegraph?"
  • "The flamegraph shows a wide frame — what does that mean?"
  • "How do I generate a flamegraph from Callgrind?"
  • "I want to compare two flamegraphs (before/after)"

Workflow

1. Install FlameGraph tools

git clone https://github.com/brendangregg/FlameGraph
# No install needed; scripts are in the repo
export PATH=$PATH:/path/to/FlameGraph

2. perf → flamegraph (most common path)

# Step 1: record
perf record -F 999 -g -o perf.data ./prog

# Step 2: generate script output
perf script -i perf.data > out.perf

# Step 3: collapse stacks
stackcollapse-perf.pl out.perf > out.folded

# Step 4: generate SVG
flamegraph.pl out.folded > flamegraph.svg

# Step 5: view
xdg-open flamegraph.svg     # Linux
open flamegraph.svg          # macOS

One-liner:

perf record -F 999 -g ./prog && perf script | stackcollapse-perf.pl | flamegraph.pl > fg.svg

3. Differential flamegraph (before/after)

# Collect two profiles
perf record -g -o before.data ./prog_old
perf record -g -o after.data ./prog_new

# Collapse
perf script -i before.data | stackcollapse-perf.pl > before.folded
perf script -i after.data  | stackcollapse-perf.pl > after.folded

# Diff (red = regressed, blue = improved)
difffolded.pl before.folded after.folded | flamegraph.pl > diff.svg

4. Callgrind → flamegraph

valgrind --tool=callgrind --callgrind-out-file=cg.out ./prog
stackcollapse-callgrind.pl cg.out | flamegraph.pl > fg.svg

5. Other profiler inputs

# Go pprof
go tool pprof -raw -output=prof.txt prog
stackcollapse-go.pl prof.txt | flamegraph.pl > fg.svg

# DTrace
dtrace -x ustackframes=100 -n 'profile-99 /execname=="prog"/ { @[ustack()] = count(); }' \
  -o out.stacks sleep 10
stackcollapse.pl out.stacks | flamegraph.pl > fg.svg

# Java (async-profiler)
async-profiler -d 30 -f out.collapsed PID
flamegraph.pl out.collapsed > fg.svg

Read the full file on GitHub · 158 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 14d ago Changed · +1 lines 3c6fecf43e19
  2. 3mo ago First seen · 157 lines · 81 tokens per session scan A 5a002fa55eab

Subscribe to this mod's changes

flamegraphs is a skill published in the GitHub repository mohitmishra786/low-level-dev-skills (310 stars, last pushed 14d ago), licensed MIT. It adds 81 tokens to every session and 1,309 once invoked, about $0.0003 per session on Opus 5.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-09-03.

Related

flamegraphs compared with skills from other repositories

flamegraphs next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
flamegraphsmohitmishra786/low-level-dev-skillsSkill31014d agoMITA81Claude Code, Codex
push-notification-testerteam-telnyx/aiSkill232todayMITA55Claude Code
log-analyzermoonlight-lupin/agent-skillsSkill1375d agoMITA52Claude Code, Codex
debugmoonlight-lupin/agent-skillsSkill1375d agoMITA104Claude Code, Codex
organic-traffic-drop-diagnosiscoupler-io/skillsSkill452d agoMITA187Claude Code
tiktok-ads-conversion-tracking-and-pixel-auditcoupler-io/skillsSkill452d agoMITA107Claude Code
error-handlerEliasOulkadi/shokuninSkill1122mo agoMITA125Claude Code