Install ap-query
The fastest way to install ap-query is using the install script:/usr/local/bin/ap-query (or ~/.local/bin/ap-query if you don’t have sudo access).
Alternative installation methods
Install via go install
Install via go install
If you have Go 1.23+ installed:The binary will be installed to
$GOPATH/bin/ap-query (usually ~/go/bin/ap-query).Manual binary download
Manual binary download
Download the latest release from GitHub Releases:
- Download the appropriate archive for your platform:
- Linux x64:
ap-query_linux_amd64.tar.gz - Linux ARM64:
ap-query_linux_arm64.tar.gz - macOS:
ap-query_darwin_amd64.tar.gzorap-query_darwin_arm64.tar.gz
- Linux x64:
- Extract and move to your PATH:
Install async-profiler
ap-query analyzes profiles created by async-profiler. You’ll need to install async-profiler to capture profiles.Download async-profiler
The easiest way is to let macOS:
ap-query init handle this automatically (see next section). Alternatively, download it manually:Linux:Add to PATH
Add the Add this line to your shell profile (
bin directory to your PATH:~/.bashrc, ~/.zshrc, etc.) to make it permanent.async-profiler requires Linux perf events or macOS DTrace. On Linux, you may need to adjust kernel settings:See the async-profiler documentation for details.
Install agent skill
The agent skill teaches coding agents (Claude Code, Codex, etc.) how to profile Java applications and analyze results with ap-query.Run ap-query init
Run the init command to install the agent skill:This command:
- Auto-detects your
asprofinstallation (or offers to download it) - Detects which agents you use (Claude Code, Codex)
- Installs the skill to the appropriate directories
- Embeds the exact paths to
asprofandap-queryon your system
Verify skill installation
The skill will be installed to one or both of these locations:
- Claude Code (global):
~/.claude/skills/jfr/SKILL.md - Codex (global):
~/.codex/skills/jfr/SKILL.md(or$CODEX_HOME/skills/jfr/SKILL.md)
Installation modes
ap-query init supports two installation modes:- Global (recommended)
- Project-local
Global installation makes the skill available to all projects:
- Claude Code: Installs to
~/.claude/skills/jfr/ - Codex: Installs to
~/.codex/skills/jfr/(or$CODEX_HOME/skills/jfr/)
Advanced init options
Explicit path to the
asprof binary. Skips auto-detection.Install to the current directory instead of home directory.
Overwrite existing skill files.
Install only for Claude Code (creates
.claude if needed).Install only for Codex (creates
.codex or .agents if needed).Print the rendered skill to stdout instead of installing. Useful for custom agents or debugging.
Updating ap-query
ap-query can self-update to the latest release:- Checks for the latest GitHub release
- Downloads and verifies the new binary
- Replaces the current binary atomically
- Auto-updates any globally installed agent skills
If you installed via
go install, use go install github.com/jerrinot/ap-query@latest instead.Next steps
Quickstart
Profile and analyze your first application
Agent Integration Guide
Learn how agents use the skill