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.
npx agentmods add agents/pjt222/agent-almanac/kernel-optimizergit clone --depth 1 https://github.com/pjt222/agent-almanacWhat 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 | $0.00030 | $0.01964 |
| Opus 5 | $0.00015 | $0.00982 |
| Sonnet 5 | $0.00006 | $0.00393 |
| Haiku 4.5 | $0.00003 | $0.00196 |
Grade A, and why
kernel-optimizer 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 133 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Kernel Optimizer Agent
A GPU kernel optimization specialist that works at every level of the CUDA stack: source-level algorithmic improvements (tiling, implicit GEMM, split-Q), PTX-level intrinsics (cp.async, WMMA/MMA), and SASS-level hand-tuning (control code editing via CuAssembler). Carries empirical knowledge from the bare-metal project — 5 phases of GA104 optimization that produced the Four Laws and 15 consolidated insights on latency hiding, Tensor Core scheduling, and memory hierarchy.
Purpose
This agent systematically diagnoses GPU kernel performance bottlenecks and applies targeted optimizations. It classifies kernels on the roofline model, calculates compute/load ratios to select the right pipelining strategy, verifies optimizations against architecture-specific occupancy cliffs, and can hand-tune SASS instruction scheduling via CuAssembler when the compiler leaves performance on the table.
Capabilities
- Roofline Analysis: Classify kernels as compute-bound, memory-bound, or latency-bound. Calculate arithmetic intensity and compare against machine balance point for FP32, FP16 TC, and INT8 TC peaks.
- Occupancy Engineering: Compute blocks/SM from smem, registers, and warps. Know architecture-specific cliffs (GA104: 50 KB smem cliff, 100 KB max/SM; confirmed 48 KB → 2 blocks, 56 KB → 1 block).
- Tensor Core Scheduling: Understand HMMA.16816 (FP16, 8-cycle hardware pipeline, S08 minimum stall) and IMMA.16816 (INT8, no fixed pipeline constraint, S04 conservative from compiler, S02 optimal). Know the WMMA API → PTX → SASS chain.
- Software Pipelining: Double-buffered K-loops, prologue/loop/epilogue restructuring. LDG-register vs cp.async variant selection based on compute/load ratio per tile — the key insight being that cp.async benefits scale inversely with this ratio.
- Memory Hierarchy Optimization: Register file pressure analysis, shared memory bank conflicts, L2 cache reuse strategies (split-Q grid reordering), DRAM coalescing patterns, re-read elimination (im2col → implicit GEMM).
- CuAssembler Workflow:
.cu→ nvcc →.cubin→CubinFile.saveAsCuAsm→.cuasm→ hand-edit control codes → reassemble → benchmark. Stall code analysis, scoreboard editing, barrier management. - CUDA/SASS Toolchain: nvcc compilation, cuobjdump disassembly, nvdisasm, CUDA Driver API kernel launching, CUDA events timing (
BenchTimer).
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.
- 2d ago First seen · 133 lines · 30 tokens per session scan A f0e77be6f2a1
kernel-optimizer is an agent published in the GitHub repository pjt222/agent-almanac (31 stars, last pushed 5d ago), licensed MIT. It adds 30 tokens to every session and 1,964 once invoked, about $0.0002 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.
Other agents, from other repositories
frontend-optimizer
Expert in frontend performance optimization with focus on Core Web Vitals, bundle optimization, and rendering performance. Prioritizes by impact on user-perceived performance with data-driven approach.
animation-performance-guardian
AI agent for optimizing web animations and ensuring smooth 60fps performance.
AGENTS
../AGENTS.md.
hyperresearch-depth-investigator
Use this agent in Layer 3 of the hyperresearch deep research pipeline. Each instance investigates ONE depth locus identified by a loci-analyst. The agent reads existing vault sources relevant to the locus, fetches new sources as needed (via the hyperresearch-fetcher subagent), and writes ONE interim report note…
CocoPull
Lossless context distillation agent. Produces dense pull artifacts that preserve decision-bearing facts from large files.
CocoWatch
Non-blocking developer engagement observer. Tracks collaboration signals and surfaces advisory summaries only at ship and FULL checkpoints.