AutoMegaKernel: Command for Claude Code

.claude/commands/amk-autoresearch.md

amk-autoresearch is a command for Claude Code from RightNow-AI/AutoMegaKernel. It costs 25 tokens per session (764 once invoked), scanned A, original, MIT.

A command that runs an unattended AutoMegaKernel performance search for a model and GPU. It repeatedly tests schedule changes within a time or iteration budget.

In plain words
What is it for?
It helps developers run resumable, crash-resistant optimization campaigns for model GPU kernels. It requires a CUDA GPU for real measured performance and compares results with AutoMegaKernel's own default schedule.
Why use it?
It removes the need to supervise each experiment overnight or during a long tuning session. Changes are kept only when they pass correctness checks and improve on the current result.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

This is RightNow-AI/AutoMegaKernel's own configuration. It tells Claude Code how to work on AutoMegaKernel itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything AutoMegaKernel configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/RightNow-AI/AutoMegaKernel/main/.claude/commands/amk-autoresearch.md
Clone the repo
git clone --depth 1 https://github.com/RightNow-AI/AutoMegaKernel

Made for: Claude Code.

Wrote 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.

agentmods badge for amk-autoresearch

README.md
[![agentmods](https://agentmods.dev/badge/commands/rightnow-ai/automegakernel/amk-autoresearch/github.svg)](https://agentmods.dev/commands/rightnow-ai/automegakernel/amk-autoresearch)
Your own site
<a href="https://agentmods.dev/commands/rightnow-ai/automegakernel/amk-autoresearch"><img src="https://agentmods.dev/badge/commands/rightnow-ai/automegakernel/amk-autoresearch/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.

agentmods 80×15 button for amk-autoresearch

Your own site · 80×15
<a href="https://agentmods.dev/commands/rightnow-ai/automegakernel/amk-autoresearch"><img src="https://agentmods.dev/badge/commands/rightnow-ai/automegakernel/amk-autoresearch.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 764 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00025 $0.00764
Opus 5 $0.00013 $0.00382
Sonnet 5 $0.00005 $0.00153
Haiku 4.5 $0.00003 $0.00076

Measured 11d ago against content hash dad98d17208f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

amk-autoresearch 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 11d 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.

.claude/commands/amk-autoresearch.md · 43 lines

What it actually says

Launch the unattended AutoMegaKernel (AMK) autoresearch driver on $ARGUMENTS (parse as model [gpu] [minutes|iters]; default gpu = rtx5090; default model = toy). This is the headless keep/revert campaign, point it at a (model, gpu), give it a budget, and it runs the whole correctness-gated methodology unattended, resumable and crash-proof, growing the flywheel.

HARD HONESTY RULES (state them, obey them):

  • Correctness FIRST: NEVER a latency without a correctness PASS vs the CPU ReferenceVM. Keep iff 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.
  • The morning "best" is a speedup vs AMK's OWN default schedule, NOT a claim of beating cuBLAS/vLLM (AMK is within ~13% of cuBLAS at batch-1, behind it).

Do this:

  1. Confirm the environment first with amk_doctor() (CLI: amk doctor), torch/cuda availability, device name, registered targets. For a real measured-gpu campaign you need a CUDA GPU; otherwise the fitness is analytic predicted (use device="cpu").
  2. Launch the driver with amk_autoresearch(model, gpu, minutes=<M>, iters=<N>, device="auto", overnight=<bool>, cold=<bool>). CLI fallback: amk autoresearch <model> --gpu <gpu> --minutes <M> --device cuda [--overnight] [--cold] (or --iters <N> --device cpu for a fast deterministic run). Use overnight=true with a long minutes (e.g. 480 for ~8h): no plateau-stop, basin-hops to fresh regions while always preserving the global best, bounded memory, checkpointed every iteration (re-run the same command to continue), and writes a wake-up report.
  3. It is resumable + crash-proof: a CUDA error / timeout in one iteration is logged and the run continues. Re-running the same command continues the same campaign.
  4. When it finishes (or to inspect progress), report from the orchestrator: amk_orchestrate_status(), amk_orchestrate_report() (CLI: python amk_orchestrate.py status / report), and for an overnight run read workspace/amk_overnight_report.md (best config + speedup-vs-baseline + milestones + restart count).

Report: best schedule_id, best latency_us + latency_kind, pct_of_roofline, and the speedup vs AMK's own default schedule (NOT vs cuBLAS/vLLM).

Use only the canonical names: MCP amk_doctor/amk_autoresearch/amk_orchestrate_status/ amk_orchestrate_report; CLI amk doctor|autoresearch and python amk_orchestrate.py status|report.

Changes

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.

  1. 11d ago First seen · 43 lines · 25 tokens per session scan A dad98d17208f

Subscribe to this mod's changes

amk-autoresearch is a command published in the GitHub repository RightNow-AI/AutoMegaKernel (138 stars, last pushed 2mo ago), licensed MIT. It adds 25 tokens to every session and 764 once invoked, about $0.0001 per session on Opus 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.