dot_claude/skills/hyperfine/SKILL.md
Use when benchmarking CLI tools or scripts instead of time — measuring performance, comparing implementations, or tracking regressions with statistical validity.
npx skillsauth add nijaru/dotfiles hyperfineInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Benchmarks are only valid if they measure equivalent configurations under controlled conditions. Report methodology — not just numbers.
--warmup). Cold caches lie.# Single command
hyperfine --warmup 3 'my-command input.txt'
# Compare two commands (equivalent configs)
hyperfine --warmup 3 \
'tool-a --flag input.txt' \
'tool-b --flag input.txt'
# Parametric sweep
hyperfine --warmup 3 \
--parameter-scan size 100 1000 100 \
'my-command --size {size}'
| Flag | Use |
| --------------------------- | -------------------------------------------------------- |
| --warmup N | Discard first N runs (always use, min 3) |
| --runs N | Fixed run count (default: auto, min 10) |
| --min-runs N | Minimum when using auto |
| --prepare CMD | Run before each timing (clear caches, reset state) |
| --setup CMD | Run once before all runs |
| --cleanup CMD | Run after all runs |
| --export-json out.json | Machine-readable results |
| --export-markdown out.md | Table for docs/PRs |
| --shell none | Remove shell overhead for simple commands |
| --ignore-failure | Benchmark even if exit code nonzero |
| --parameter-list VAR LIST | Discrete values sweep (vs --parameter-scan for ranges) |
# macOS — drop file system cache
sudo purge
# Linux — drop page cache
sync && echo 3 | sudo tee /proc/sys/vm/drop_caches
# Use --prepare to reset between runs
hyperfine --warmup 3 \
--prepare 'sync && echo 3 | sudo tee /proc/sys/vm/drop_caches > /dev/null' \
'find /large/dir -name "*.log"'
When presenting results, always include:
Tool: hyperfine 1.x
Warmup: 3 runs
Measured: 10+ runs (auto)
Machine: [CPU, RAM, OS]
Dataset: [size, format, source]
Commands: [exact commands with flags]
| Mistake | Fix |
| ------------------------------- | ------------------------------------------------ |
| Benchmarking without warmup | Always --warmup 3 minimum |
| Comparing debug vs release | Match build flags exactly |
| No cache preparation | Use --prepare to reset state |
| Reporting mean only | Include stddev — high variance = noisy benchmark |
| Different input sizes | Use --parameter-list to sweep fairly |
| Shell overhead in fast commands | Use --shell none for sub-millisecond ops |
--runs downward without reason.# Save baseline and new results separately
hyperfine --warmup 3 --export-json before.json 'old-tool input'
hyperfine --warmup 3 --export-json after.json 'new-tool input'
# Compare with hyperfine's bundled script
# (find it at: $(dirname $(which hyperfine))/../share/hyperfine/scripts/)
python3 scripts/compare.py before.json after.json
# Or extract means manually
jq '.results[0] | {command, mean, stddev}' before.json after.json
development
Use after completing a bug fix, feature, refactor, or tk task when the first implementation taught enough context to replace it with a simpler, cleaner, or more coherent version before finalizing.
development
Use when writing, migrating, or reviewing Zig code across recent stable versions (0.14-0.16), especially to correct stale syntax or stdlib, build.zig, allocator, formatting, or runtime API knowledge.
documentation
Use when reviewing or revising text (prose, docs, commits) to remove AI patterns and improve voice/clarity.
content-media
Use when fetching X/Twitter post content by URL, or searching for recent X posts.