/remote-kernels:setupfrom remote-kernels
Sets up or repairs cloud GPU access for RunPod, vast.ai, or Kubernetes via the remote-kernels MCP server. Handles platform checks, config generation, and environment setup.
Ships in remote-kernels. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
One-time setup that lets Claude control cloud compute through the
remote-kernels MCP server. The goal is to encode the user's preferences and
project conventions into remote-kernels.toml, and to set up the required
environment variables. Prefer inferring configuration from the project's
code, docs, and existing infrastructure; ask the user only when inference
isn't possible or is genuinely ambiguous.
${CLAUDE_PLUGIN_ROOT}/scripts/bootstrap.sh platform-check — silent and exit 0
means all is well, go on. It only fails when a platform-specific plugin entry
for a different machine is enabled: those bundle one target's binary, so the
wrong one cannot run and the MCP server will not start. It prints the entry
that should be there, e.g. remote-kernels-aarch64-apple-darwin.
Fix it by editing whichever settings file enables the wrong key: replace it
with <printed-name>@alignment-hive, keeping the value true. Exactly one
remote-kernels key may be enabled across all settings files — the plain
remote-kernels@alignment-hive and any platform entry declare the same MCP
server, so two of them load twice. A platform key belongs only in a
machine-local settings file; if the wrong one came from a checked-in
.claude/settings.json, moving it to .claude/settings.local.json is the fix,
and collaborators need to add the entry for their own machines.
Then tell the user to restart Claude Code and re-run this skill.
When remote-kernels.toml sets [runpod] network-volume-id but no
workdir, settle that first: the "Network volumes" section of
references/runpod.md covers it.
Infer from the project when possible (Kubernetes manifests or kubeconfig
references → kubernetes; an existing RUNPOD_API_KEY/VAST_API_KEY in
.env.local; mentions in the README or docs). Otherwise ask, using the
comparison above. Multiple runtimes can coexist — one is the default,
others stay reachable via start(runtime=...).
Generate the template for exactly the chosen runtime(s) — the flag is
repeatable — and save it as remote-kernels.toml at the project root:
${CLAUDE_PLUGIN_ROOT}/scripts/bootstrap.sh config-template --runtime <runtime>
The generated file's comments document every field, its default, and the tradeoffs. Walk through the file with the user and edit it, preferring values inferred from the project (existing images, GPU needs implied by the workload, install steps from the README).
Then read the reference file for each chosen runtime — it covers setup steps and pitfalls that are NOT config fields:
references/runpod.mdreferences/vast.mdreferences/kubernetes.mdEach reference file has an "Advanced" section (custom images, Jupyter exposure and security tradeoffs, search-filter overrides). Most users don't need any of it: ask once whether they want to hear about advanced configuration or security tradeoffs, and skip those sections unless they say yes.
Cover these with the user regardless of runtime:
.env.local (gitignored); the reference
file names the exact variable and where to get it. Kubernetes needs no
key (kubeconfig).inherit-env forwards the local variables it names
(including ones from .env/.env.local); explicit values go in [env].REMOTE_KERNELS_BUDGET in .claude/settings.json's
env section rather than budget-cap in remote-kernels.toml: the env var
overrides the TOML, and settings.json edits get extra protection from
Claude Code that an ordinary project file doesn't — a strong guardrail,
though not an absolute guarantee in fully-automatic permission modes.
Optional: no budget means the user manages spend manually, and that is a
supported choice. When set, the cap is per Claude session: it covers
the estimated spend of machines that session started plus, from the moment
of attach, machines it adopted, including storage on a stopped machine
(status() shows that tail). Separately managed network volumes and anything
else the plugin doesn't track aren't counted. The count is cumulative for
the life of the session (it survives restarts, backgrounding, and machine
termination; it resets only with a genuinely new session), and concurrent
sessions have independent caps. Past the cap, tool calls that add work are
refused and the session's running machines get a grace window to save, then
stop or terminate themselves; a running machine left behind by an ended
session keeps enforcing that session's remaining budget until adopted. The
cap is not a hard ceiling on the bill: the grace window can go past it, and
a stopped machine keeps billing for storage until someone terminates it,
even after its session has ended. Frame the cap as a generous limit, not a
spending target — Claude should always stop or terminate machines that are
no longer in use, and the budget is the backstop for when that fails. The
money-safety windows (orphan halt, provision timeouts, budget
grace) are also config with sane defaults — mention they exist in the
template rather than walking through each..ipynb file under remote-kernels/ at the project root (one notebook
per kernel; configurable via notebook-dir). Decide with the user whether
to commit these or gitignore the directory.The most consequential conversation — have it explicitly. Two linked
decisions: where remotely-generated data (checkpoints, results, logs)
lives, and what a machine may do to itself when the session ends (the
per-runtime cleanup key). They must be decided together: terminate, the
default, deletes machine-local data; separately managed network volumes and
Kubernetes PVCs survive. The plugin does not automatically back up result files.
RunPod and vast machines clean themselves up after a disconnect: they wait for
work, run the finalize command, then act, subject to configured idle-wait and
budget-grace limits. A RunPod machine without SSH can't, and status() says so
when that's the case. Kubernetes pods survive
disconnects: their finalize command runs on explicit termination, not when a
pod lifetime limit fires. Data can reach safety along three routes:
sync() ships to the
machine), otherwise in CLAUDE.md, a skill, or a memory — so future
sessions apply it without being reminded.download() results back
to the project right after they're produced. No machine-side setup, but a
disconnect between producing and downloading falls through to the
finalize command below.pre-terminate-command / pre-stop-command, run in the workdir and chosen
by the action about to happen (an action with no command saves nothing).
Self-cleanup and finish() run it after waiting for running work, when they
stop or terminate (a keep plan saves nothing); an explicit
stop()/terminate() runs it right away without waiting for kernels, and
only if it can reach the machine. Ask directly: "if a machine has to clean
itself up while you're away, where should results go?" — and set the command
that puts them there. The machine needs that tool and its credentials (an
image or startup command can install them). If the command exits nonzero or
times out, terminate degrades to stop, which keeps persistent storage but not
a RunPod pod's container disk; a Kubernetes pod is kept running instead. When the finalize command
reliably syncs everything, in-session downloads of the same artifacts are
redundant (and doubly transferred) — pick which route owns which data.Leaving all of this unset is a valid answer, spelled out plainly: terminate may then lose unsynced work.
With the persistence plan settled, have the user actively choose the cleanup mode rather than silently keeping the default:
terminate (default) — machine and its own disks deleted, a pod's own
volume included, and those stop costing anything. Network volumes and PVCs
stay, with their data and charges. Safe exactly to the extent the plan above
is real.stop — machine kept for a later attach(). Persistent storage survives
and keeps billing until someone terminates it; kernel memory and a RunPod
container disk don't survive. A GPU isn't guaranteed on resume, and on vast a
stopped machine may never be resumable (its GPU can be re-rented) — prefer
terminate there.disabled — no self-cleanup; the user owns the lifecycle and the bill. A
start that misses its provision timeout is still terminated, and on vast a
machine no session ever reached still stops itself.Tell the user to reload the MCP server (run /mcp or restart Claude Code)
so the new config takes effect, then offer to try starting a machine for
them.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub crazytieguy/alignment-hive --plugin remote-kernelsOther plugins' skills for the same job