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-optimize.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-optimize)<a href="https://agentmods.dev/commands/rightnow-ai/automegakernel/amk-optimize"><img src="https://agentmods.dev/badge/commands/rightnow-ai/automegakernel/amk-optimize/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-optimize"><img src="https://agentmods.dev/badge/commands/rightnow-ai/automegakernel/amk-optimize.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.00027 | $0.00778 |
| Opus 5.5 | $0.00011 | $0.00311 |
| Sonnet 5.5 | $0.00005 | $0.00156 |
| Haiku 4.5 | $0.00003 | $0.00078 |
Grade A, and why
amk-optimize 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
Drive an interactive AutoMegaKernel (AMK) schedule-optimization session on $ARGUMENTS
(parse as model [gpu]; default gpu = rtx5090; default model = toy). Use the
megakernel-optimization skill's loop and obey its HARD HONESTY RULES.
HARD HONESTY RULES (state them, obey them):
- Correctness FIRST: NEVER report a latency without a correctness PASS vs the CPU ReferenceVM. Keep a candidate only if it is correct AND >= 1% faster than the incumbent.
- validate-before-launch: an unsafe ScheduleConfig is a clean REJECTED, never a hung GPU.
- Edit surface is ScheduleConfig + kernel_knobs ONLY, never kernel code, never vm/ or the ABI.
- Measured-gpu latency is drift-robust; impossible sub-roofline latencies are withheld.
- Speedups are vs AMK's OWN default schedule, NOT a claim of beating cuBLAS/vLLM.
Do this:
- Read the edit surface with
amk_propose(model, gpu)(CLI fallback:amk propose <model> --gpu <gpu>). Report the incumbentschedule_configand the editablesearch_space(including thekernel_knobs.*sub-surface). - Establish the baseline with
amk_eval(model, gpu, <incumbent cfg>, device="auto")(CLI: writecfg.json,amk eval <model> --gpu <gpu> --config cfg.json). RequirevalidANDcorrect. Record itslatency_usas the incumbent latency. - Loop: propose ONE knob change off the current best (one ScheduleConfig knob OR one
kernel_knobsfield per trial),amk_evalit, and keep/revert, keep ONLY ifvalidANDcorrectANDlatency_us < incumbent_latency_us * 0.99. After each trial callamk_orchestrate_record(status, latency_us=..., pct_roofline=..., kind=..., config=..., description=...)withstatusinkept/revert/failed/crash/timeout/rejected(revertis the canonical token for any correct-but-not-kept candidate). - Between trials, consult
amk_orchestrate_next()(continue-or-STOP) andamk_orchestrate_status()(baseline/best/speedup/plateau). Stop whennextsays STOP or the user asks. To run the full keep/revert loop in one shot instead, useamk_loop(model, gpu, budget=N)(CLI:amk loop <model> --gpu <gpu> --budget N).
Finish with a short report: best schedule_id, best latency_us + latency_kind,
pct_of_roofline, and the speedup vs the incumbent baseline (clearly stated as vs AMK's own
default, not vs cuBLAS/vLLM).
Use only the canonical names: MCP amk_propose/amk_eval/amk_loop/amk_orchestrate_record/
amk_orchestrate_next/amk_orchestrate_status; CLI amk propose|eval|loop and
python amk_orchestrate.py record|next|status.
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 · 42 lines · 27 tokens per session scan A d2bd5e528ca6
amk-optimize is a command published in the GitHub repository RightNow-AI/AutoMegaKernel (161 stars, last pushed 1mo ago), licensed MIT. It adds 27 tokens to every session and 778 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-optimize compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| amk-optimizeRightNow-AI/AutoMegaKernel | Command | 161 | 1mo ago | MIT | A | 27 | Claude Code |
| eol-reportWYRE-AI/msp-claude-plugins | Command | 52 | yesterday | Apache-2.0 | A | 28 | Claude Code |
| rvcsi-calibrateruvnet/rvcsi | Command | 28 | 25d ago | Apache-2.0 | A | 20 | Claude Code |
| dev-plannerzxpmail/ReqForge | Command | 18 | 1mo ago | MIT | A | 16 | Claude Code |
| esp-hardenmathisk2095/jko-claude-plugins | Command | 3 | 24d ago | MIT | A | 17 | Claude Code |
| putdesplega-ai/ai-toolbox | Command | 37 | 9d ago | none | A | 13 | Claude Code |
| debugcaptainluzik/oh-my-embedded | Command | 38 | 8mo ago | MIT | A | 13 | Claude Code |