AutoMegaKernel AGENTS.md

AutoMegaKernel AGENTS.md is an instructions file for Codex, OpenCode from RightNow-AI/AutoMegaKernel. It costs 2,279 tokens per session, scanned B, original, MIT.

A repository guide for AutoMegaKernel, a system that compiles a Llama-family model into one fused CUDA computation and searches for faster execution schedules.

In plain words
What is it for?
Use it to inspect or tune schedule configuration and kernel settings, run measured optimization experiments, and follow the project's required AMK workflow.
Why use it?
It tells coding agents which files and settings they may change and how to run the verified optimization loop without bypassing safety or correctness checks.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/rightnow-ai/automegakernel/agents-md
Clone the repo
git clone --depth 1 https://github.com/RightNow-AI/AutoMegaKernel

Made for: Codex, OpenCode.

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 AutoMegaKernel AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/rightnow-ai/automegakernel/agents-md.svg)](https://agentmods.dev/instructions/rightnow-ai/automegakernel/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/rightnow-ai/automegakernel/agents-md"><img src="https://agentmods.dev/badge/instructions/rightnow-ai/automegakernel/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,279 This file is loaded in full into every session.
When invoked 2,279 The same file — it is already loaded in full.
Security scan B 1 finding. Scan, not verified.
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 $0.02279 $0.02279
Opus 5 $0.01140 $0.01140
Sonnet 5 $0.00456 $0.00456
Haiku 4.5 $0.00228 $0.00228

Measured 5d ago against content hash dc41872134a9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

AutoMegaKernel AGENTS.md scanned grade B with 1 finding 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 5d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

## Codex MCP server config (`~/.codex/config.toml`)
AGENTS.md · 149 lines

How it starts

The opening of the file, as written. The whole thing — 149 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md, AutoMegaKernel for native coding agents (Codex / Claude Code)

This is the Codex/native-agent guide to driving AutoMegaKernel (AMK), the Codex analogue of CLAUDE.md. It tells an agent exactly what AMK is, the one edit surface it owns, the canonical tool/CLI names, the non-negotiable honesty rules, and a copy-paste optimization loop. Everything here maps 1:1 to existing, verified code; nothing is faked.

For the full human/agent contract read HARNESS.md. For what AMK is and what is measured-real today, read README.md.


What AMK is

AMK compiles a HuggingFace Llama-family model into ONE persistent CUDA megakernel, the whole forward pass fused into a single cooperative kernel launch, and self-improves the schedule over its own baseline, correctness-gated, unattended. It is the sibling of AutoKernel (which tunes one kernel); AMK tunes the whole-model megakernel via a new search axis: the schedule.

The agent's job is to search the schedule, not to write kernels. The frozen VM deterministically lowers a ScheduleConfig into a runnable megakernel and proves it deadlock/race-free before any launch. An unsafe config is a clean REJECTED, never a hung GPU.

The edit surface, ScheduleConfig + kernel_knobs ONLY

You edit one structured object: a ScheduleConfig (a JSON dict of typed knobs), optionally with a kernel_knobs sub-object. You NEVER touch raw kernel code, vm/, Task.sm, or the frozen ABI. The schema is [schemas/schedule_config.schema.json]; the live, machine-readable knob list comes from amk_propose(...)["search_space"]. The knobs:

knob type choices meaning
tiling.gemv.N_tile int 64,128,256,512 GEMV output-column tile width (the one tiling knob lowered today)
tiling.attention.kv_block int 64,128,256 KV window block (recorded; not yet lowered)
fusion_grouping list[list[str]] [], [["gate","up"]], ... op groups to co-reside (a safe hint)
sm_assignment str/dict round_robin/load_balance/map SM placement policy
pipelining_depth int 0–4 typ. instructions ahead to prefetch weights (hides the HBM bubble)
page_allocation str graph_color/linear/none activation page reuse policy
threads_per_block int 128,256,512 persistent VM block size (occupancy-proven)
smem_bytes_per_block int 0,16384,49152 dynamic SMEM opt-in (over-cap = clean reject)

Read the full file on GitHub · 149 lines

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. 5d ago First seen · 149 lines · 2,279 tokens per session scan B dc41872134a9

Subscribe to this mod's changes

AutoMegaKernel AGENTS.md is an instructions file published in the GitHub repository RightNow-AI/AutoMegaKernel (137 stars, last pushed 2mo ago), licensed MIT. It adds 2,279 tokens to every session, about $0.0114 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.