CLI for analyzing async-profiler JFR recordings.
Built for coding agents (Claude Code, Codex, etc.), not for human-first interactive profiling workflows. Born out of frustration from watching agents struggle with raw profiling data - burning tokens, polluting context, and still getting lost.
curl -fsSL https://raw.githubusercontent.com/jerrinot/ap-query/master/install.sh | sh# global skill installation for all projects
ap-query init
# or just for the current project directory
ap-query init --project
Profile this program with async-profiler and analyze the result with ap-query.
Start with hotspot triage, then drill down and report concrete next actions.
ap-query init writes a SKILL.md file for your agent so it knows how to
profile/analyze JVM recordings with ap-query.
The command auto-detects asprof and ap-query paths and embeds them into the
skill file. If asprof is missing, it can download async-profiler to
~/.ap-query/.
Some agents may auto-activate the skill based on prompt context. If not, ask
explicitly to use ap-query.
- Project-local:
ap-query init --project --codexorap-query init --project --claude - Global:
ap-query init --codexorap-query init --claude
.jfr/.jfr.gz: parsed as JFR binary (supports--event cpu|wall|alloc|lock)- other files: parsed as collapsed-stack text (
frames;... count) -: read collapsed text from stdin
| Flag | Description |
|---|---|
--asprof PATH |
Explicit path to asprof (skips auto-detection and interactive prompt) |
--project |
Install into the current directory instead of home |
--force |
Overwrite existing skill files |
--claude |
Install only for Claude Code (.claude/skills/jfr/) |
--codex |
Install only for Codex (.codex/skills/jfr/ global, .agents/skills/jfr/ project) |
--stdout |
Dump rendered skill to stdout (for piping into custom agents) |
ap-query --help