ForgeKernel CLI
ForgeKernel is a CLI that tunes a GPU kernel for hours: Claude Code writes variants, timing and profiling drop slower ones.
- 319 ★ on the repository
- Last commit
- Apache-2.0
Broad access
Why this level
- The agent writes and runs code on your GPU or over ssh for hours without confirming each step.
- A run spends Claude tokens and occupies the GPU.
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/forgekernelDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- The agent writes and runs code on your GPU or over ssh for hours without confirming each step.
- A run spends Claude tokens and occupies the GPU.
This is third-party code. Review the repository files before installing.
What it does
ForgeKernel takes a reference kernel, runs, times and profiles it, then builds a milestone plan of optimization steps. Claude Code implements decisions one at a time per that plan, and a single GPU job checks correctness, timing and profile. A faulty variant is reverted. Every accepted kernel becomes the reference for the next pass, so optimization continues past the best known implementation. Findings certified by a hardware probe accumulate in a knowledge base shared across operators. Tasks are described in `task.toml` and a run starts with `forge run`.
Who it is for. GPU kernel engineers on Hopper and Blackwell who want to hand an agent hours of operator tuning against measurements.
Good fit when
- Nine RMSNorm launches are not yet fused into one CuTe DSL kernel.
- Your kernel is slower than the library one and the losses are unknown.
- A run was interrupted and has to continue from where it stopped.
- You want a report and the best kernel with a profile after a night of work.
Not a fit when
- The GPU is neither Hopper nor Blackwell: `sm90` and `sm100` are supported.
- There is no Claude Code access through login or `ANTHROPIC_API_KEY`.
- You need a kernel fix in minutes while a run takes hours.
Example request
Create a task in `tasks/rmsnorm`, check it with `forge new --dry-run` and start the run in tmux. Then show progress and the final report.Limitations
You need Linux or macOS, Python 3.11 or newer, Git and Claude Code, plus a Hopper (`sm90`) or Blackwell (`sm100`) GPU on this machine or over ssh. CuTe DSL tasks recommend `nvidia-cutlass-dsl`, and profiling uses Nsight Compute: without it a run goes on timings alone. One run takes hours and spends Claude tokens. Speed-up figures in the README come from the authors' paper; on your hardware the result differs.
How to disable. Stop `forge run` and delete the virtual environment and the project's `.artifacts` folder. If you set up a remote GPU, remove `local.env` and clean the working directory on that host.
FAQ
How can I tell a run is progressing?
Run `forge status .artifacts/rmsnorm_<id>` to see progress. If the run was interrupted, `forge run` with the same path continues it.
Where is the result?
The report is in `.artifacts/rmsnorm_<id>/report.md` and the best kernel in `best/kernel.py`. In the README example on a B200 it reached 5.2 times the PyTorch reference in about 1.5 hours.
Can I use a remote GPU?
Yes, set `FK_DELIVERY=ssh`, `REMOTE_HOST` and `REMOTE_WORKDIR` in `local.env`. The ssh alias must log in without a prompt.
What code comes out?
Reference code does not enter the kernel: the milestone stores decisions and contracts, and code lives only in the `hw_kb` knowledge base.
Which GPUs are needed?
NVIDIA Hopper (`sm90`) or Blackwell (`sm100`). For Hopper set `arch = "sm90"` in the example `task.toml`.
Discussion
No questions or reviews yet.
Related
CLI toolsA Claude Code skill for GPU kernel tuning: the agent profiles, edits and benchmarks a kernel in a loop until speedup stalls.
An Alibaba framework for tuning GPU kernels with coding agents: a Supervisor checks correctness and speed first
A CLI and Claude Code plugin taking GitHub issues through checks, plan, code, review and CI to merge, in parallel lanes
Skills for writing, debugging, measuring and optimizing TileLang and CUDA programs from source, lowering and profiler evidence
Holds write-ups of GPU kernel optimizations for Blackwell and Hopper so an agent answers from sources, not model memory.
LoopForge Local adds a role-based dev workflow to Claude Code, Codex and Cursor: analysis, design, code, review and tests.
README in short
The project describes a self-reinforcing loop: reference, milestone plan, agent implementation, GPU check and promotion of the best kernel to a new reference. Released kernels, a paper and sample tasks are included.