Borrowing it
Nothing to install: this file belongs to RightNow-AI/AutoMegaKernel. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/RightNow-AI/AutoMegaKernel/main/.claude/commands/amk-compile.mdgit clone --depth 1 https://github.com/RightNow-AI/AutoMegaKernelWrote 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.
[](https://agentmods.dev/commands/rightnow-ai/automegakernel/amk-compile)<a href="https://agentmods.dev/commands/rightnow-ai/automegakernel/amk-compile"><img src="https://agentmods.dev/badge/commands/rightnow-ai/automegakernel/amk-compile/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.
<a href="https://agentmods.dev/commands/rightnow-ai/automegakernel/amk-compile"><img src="https://agentmods.dev/badge/commands/rightnow-ai/automegakernel/amk-compile.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00029 | $0.00623 |
| Opus 5.5 | $0.00012 | $0.00249 |
| Sonnet 5.5 | $0.00006 | $0.00125 |
| Haiku 4.5 | $0.00003 | $0.00062 |
Grade A, and why
amk-compile 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 2mo 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.
What it actually says
One-shot compile and verify a model into a single persistent CUDA megakernel with AutoMegaKernel
(AMK) on $ARGUMENTS (parse as model [gpu]; default gpu = rtx5090; default model =
toy). This is THE product path: import -> lower -> validate (deadlock + race free) -> verify vs
eager -> build the GPU megakernel -> measure against the HBM roofline -> emit a correct megakernel
- report.
HARD HONESTY RULES (state them, obey them):
- Correctness FIRST: the compile path verifies vs eager PyTorch AND the CPU ReferenceVM; a latency is NEVER reported without a correctness PASS.
- validate-before-launch: an unsafe schedule is a clean REJECTED (deadlock/race-free proof), never a hung GPU.
- The edit surface (if you tune afterward) is ScheduleConfig + kernel_knobs ONLY, never kernel code, never vm/ or the frozen ABI.
- Measured-gpu latency is drift-robust; impossible sub-roofline latencies are withheld.
- Any speedup is vs AMK's OWN baseline, NOT a claim of beating cuBLAS/vLLM.
Do this:
- Confirm the environment with
amk_doctor()(CLI:amk doctor), torch/cuda, device name, nvcc, registered targets. A CUDA GPU + nvcc is required to build and measure the megakernel. - Compile and verify in one shot via the CLI:
amk compile <model> --gpu <gpu> --regime single-stream(equivalentlyuv run python amk_cli.py compile <model> --gpu <gpu> --regime single-stream). This lowers, statically validates, verifies correctness vs eager, builds the GPU megakernel, and measures it against theweights / HBM_bandwidthroofline, emitting the megakernel + report. - Report the result: correctness PASS (vs eager + ReferenceVM), measured per-token
latency_uslatency_kind,pct_of_roofline, and theschedule_id. If correctness did not PASS, report the failure honestly and do NOT report a latency.
Optional next step: to tune the compiled schedule, run /amk-optimize <model> <gpu> (interactive
propose -> eval -> keep/revert) or /amk-autoresearch <model> <gpu> (unattended). Speedups there
are vs AMK's own default schedule, not vs cuBLAS/vLLM.
Use only the canonical names: CLI amk compile and amk doctor (MCP amk_doctor for the
environment check).
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.
- 2mo ago First seen · 40 lines · 29 tokens per session scan A 130f34cd7d13
amk-compile is a command published in the GitHub repository RightNow-AI/AutoMegaKernel (161 stars, last pushed 1mo ago), licensed MIT. It adds 29 tokens to every session and 623 once invoked, about $0.0001 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-08-30.
amk-compile compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| amk-compileRightNow-AI/AutoMegaKernel | Command | 161 | 1mo ago | MIT | A | 29 | Claude Code |
| PARAMETERwebgptorg/promptbook | Command | 170 | today | none | A | 0 | Claude Code |
| recommend-modeliButters/ClaudeCodePlugins | Command | 3 | 10mo ago | none | A | 8 | Claude Code |
| data-pipelineEngineerWithAI/engineerwith-agents | Command | 4 | 10mo ago | MIT | A | 0 | Claude Code |
| checklistgithub/spec-kit | Command | 148k | yesterday | MIT | A | 13 | Claude Code |
| clarifygithub/spec-kit | Command | 148k | yesterday | MIT | A | 27 | Claude Code |
| specifygithub/spec-kit | Command | 148k | yesterday | MIT | A | 13 | Claude Code |