pod-preemption

pod-preemption is a skill for Claude Code, Codex from boettiger-lab/data-workflows. It costs 105 tokens per session (1,769 once invoked), scanned A, original, BSD-3-Clause.

A guide to investigating Kubernetes jobs whose pods are being stopped before they finish. Kubernetes is a system that runs workloads in containers across a cluster.

In plain words
What is it for?
Use it to inspect job status, priority classes, pod mortality, retry settings, and parallelism for long-running workloads.
Why use it?
It shows how to tell ordinary task failures apart from pod deaths caused by preemption, eviction, memory limits, or excessive parallelism. This prevents hidden retries from making an unreliable job look successful.

Skill for Claude CodeCodex

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 skills/boettiger-lab/data-workflows/pod-preemption
Any agent
npx skills add boettiger-lab/data-workflows --skill pod-preemption
Clone the repo
git clone --depth 1 https://github.com/boettiger-lab/data-workflows

Made for: Claude Code, Codex.

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 pod-preemption

README.md
[![agentmods](https://agentmods.dev/badge/skills/boettiger-lab/data-workflows/pod-preemption.svg)](https://agentmods.dev/skills/boettiger-lab/data-workflows/pod-preemption)
Your own site
<a href="https://agentmods.dev/skills/boettiger-lab/data-workflows/pod-preemption"><img src="https://agentmods.dev/badge/skills/boettiger-lab/data-workflows/pod-preemption.svg" alt="Measured on agentmods" height="20"></a>
Per session 105 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,769 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 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.00105 $0.01769
Opus 5 $0.00053 $0.00885
Sonnet 5 $0.00021 $0.00354
Haiku 4.5 $0.00011 $0.00177

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

Security

Grade A, and why

pod-preemption scanned grade A 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 4d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s "https://s3-west.nrp-nautilus.io/<bucket>?list-type=2&prefix=<path>/hex/h0=<cell>/" \
.claude/skills/pod-preemption/SKILL.md · 148 lines

How it starts

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

Pod Preemption

The tell: failed far exceeds the number of failed indexes

An indexed Job reports both counts. Read them together:

kubectl -n geo-workflows get job <name> \
  -o jsonpath='succeeded={.status.succeeded} failed={.status.failed} failedIndexes={.status.failedIndexes}{"\n"}'

A real example from the CHELSA build (data-workflows #564):

succeeded=120 failed=47 failedIndexes=39,43

122 indices, only two ultimately failed — so roughly 45 pods died and were retried successfully. That ~28% pod mortality is the signal. failed counts pod deaths, not indices; when it is many times larger than len(failedIndexes), the work is fine and the pods are being killed underneath it.

A job can even report Complete=True while this is happening. Retries hide it. Check the gap on every long job, not just failing ones.

Why it happens

priorityClassName: opportunistic on NRP carries priority -2000000000 — the lowest value available. Verify what a pod actually got:

kubectl -n geo-workflows get pods -l <selector> \
  -o custom-columns='NAME:.metadata.name,PRIOCLASS:.spec.priorityClassName,PRIO:.spec.priority'

Preemption risk scales with how long a pod runs. A 5-minute opportunistic pod is nearly always fine; a multi-hour one is a large target and will be evicted repeatedly. Pod runtime is the variable that matters, far more than pod count.

Do not misread it as a data problem

The failing indices are usually not special. In #564 the two that failed looked meaningful — both were sparse-land ocean cells — and that coincidence cost two diagnostic cycles. The same h0 then:

run retries per index outcome
parallelism 40 3 attempts failed
parallelism 2 2 attempts failed
single pod 1 attempt succeeded, unchanged

The variable was the retry budget against a background death rate — not the cell, not the code, not parallelism. Before investigating the data, re-run one failing index on its own. If it succeeds unchanged, it was environmental.

Read the full file on GitHub · 148 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. 4d ago First seen · 148 lines · 105 tokens per session scan A 07a1bf8739c1

Subscribe to this mod's changes

pod-preemption is a skill published in the GitHub repository boettiger-lab/data-workflows (5 stars, last pushed 4d ago), licensed BSD-3-Clause. It adds 105 tokens to every session and 1,769 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

compute-env-setup

Set up a reproducible Feynman compute environment for research jobs. Use when a task needs Python/R packages, GPU libraries, containers, Modal, SSH, caches, or managed model runtime setup.

companion-inc/feynman · 45 tokens

docker-extend

Use when: User wants to extend Docker with custom tools, personalize the Docker environment, or set up user-specific Docker customization. Triggers: 'extend docker', 'docker-extend', 'add tools to docker', 'customize docker', 'add my tools to the container', 'personalize docker setup', 'docker user setup', 'install…

coleam00/Archon · 118 tokens

nvca-chart-release

Release NVCA Operator chart changes from the native monorepo source to the vendored Helm chart. Use when updating the vendored NVCA Operator chart, changing NVCA image refs, publishing helm-nvca-operator, or validating the chart against a self-managed control plane.

NVIDIA/nvcf · 61 tokens

portainer-mcp-hygiene

How to drive the Portainer MCP server's tools correctly — both reading and mutating. Reading: project responses with select (JMESPath), where the heavy fields live (snapshots, status blocks, managed fields), how to handle non-JSON Docker/K8s proxy endpoints (container and pod logs, stats, exec), and how to interpret…

portainer/portainer-mcp · 315 tokens

infrastructure-setup

Provides project infrastructure conventions and review criteria for local setup, Docker, Git hooks, CI/CD, service delivery, release artifacts, monitoring, backups, and operations. Use when: "настрой инфраструктуру", "измени CI/CD", "подготовь деплой", "настрой Docker", "собери release artifact", "настрой мониторинг"…

pavel-molyanov/molyanov-ai-dev · 113 tokens

pentest-cloud-infrastructure

Cloud security posture management and container security assessment for AWS, Azure, GCP, and Kubernetes.

jd-opensource/JoySafeter · 25 tokens