Kernel Ladder — Development skill for Claude Code
Agent harness that writes and verifies GPU kernels.
How to install Kernel Ladder
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open anchi205/kernel-ladder and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Kernel Ladder does
Agent harness that writes and verifies GPU kernels. Claude proposes Triton kernels; a fixed verifier gates correctness, determinism and speed. Retry loop with exit rules, parallel strategy graph, undo-cost gates, remote CUDA runner. Benchmarked vs torch.compile and library ops on an NVIDIA GB10
Alternatives in Development
- Arreflect — AgentRecall consolidation & reflection — periodic triage of recurring corrections; proposes rule changes, neve 370 ★
- Cloud Run Debug — Diagnose a failing Cloud Run service — Antigravity (agy/Gemini) digests the error logs cheaply, Claude infers 284 ★
- Position Ladder — Position Ladder — Staged Entry & Cost-Basis Management 192 ★
README
KernelLadder
An agent that writes and optimizes GPU kernels and proves every speedup, built on the harness / loop / graph ladder. This stage is the check: correctness against a fixed reference, then timing against it, with EXPECTED / SAW / FENCE / DEAD ENDS feedback.
Ops
| op | what it is | reference |
|---|---|---|
softmax |
row softmax | torch's fused kernel (hard to beat) |
rmsnorm |
RMS normalization | unfused eager ops (fusion wins) |
attention |
causal scaled dot-product attention | naive: materializes the score matrix |
int8_matmul |
int8 x int8 with per-row/col scales | float matmul + 2 scale multiplies |
kv_quant |
quantize new K/V rows to int8 + scales (2 outputs) | 8 eager kernels |
Setup
uv venv && uv pip install -e ".[dev]"
pytest -q # CPU-side tests; GPU tests skip without KL_SSH_TARGET
The remote GPU box needs its own environment: see REMOTE_SETUP.md.
Run checks on a remote GPU container
export KL_SSH_TARGET=user@host KL_CONTAINER= KL_SSH_KEY=~/.ssh/id_ed25519
# optional: KL_REMOTE_PYTHON (default ~/kl-venv/bin/python), KL_REMOTE_DIR (default ~/work/kernelladder)
kernelladder check softmax candidates/softmax_stable.py --remote --min-speedup 0
The verifier and reference ops are synced to the box on each run; the candidate is sent on stdin. Remote tests skip unless `KL_SSH_TARGET` is set.
Let Claude write the kernel
kernelladder optimize rmsnorm --remote --target 1.5 --max-attempts 8 # --proposer code (default)
The default proposer runs the local `claude -p` CLI (Claude Code, logged in with a subscription), with tools off in an empty directory. All results in RESULTS.md came from it. `--proposer api` uses the Anthropic API instead and needs `ANTHROPIC_API_KEY` (or `ant auth login`). The agent is nondeterministic: re-running gives different kernels, while the checker itself is deterministic.
The parallel strategy graph
kernelladder graph attention --re
Related Skills
Triton GPU Kernel Optimization
Write high-performance tiled Triton GPU kernels with autotune, grouped tile ordering, stride-based addressing,
Qqcode
A lightweight CLI coding agent focused on speed, determinism, and developer control
Triton Flash Attention V2
Implement FlashAttention v2 kernels in Triton with online softmax, causal masking, GQA head routing, multi-str
Moe Swarm
Claude Code agents that optimize CUDA/Triton kernels. DeepSeek-V3 FP8 MoE: 3.17x faster than FlashInfer's CUTL
Determinism And Replay
Architecture-level determinism and replay for systems whose past behaviour must be recoverable as a fact - RL
Relogin
Re-authenticate one Claude Max account (next/next2/next3/next4) through the automated ladder — headless refres
Related Agents
Fk Kernel Engineer
Writes and integrates GPU kernels (Triton, TileLang, CuTe DSL, CUDA C++, CUDA graphs, torch.compile) under can
Metal Expert
Read-only Metal reviewer. Use when reviewing custom GPU rendering, MTKView, shaders, compute kernels, command