/kaggle-tools:kaggle-code-competitionsfrom kaggle-tools
Guides notebook submission for Kaggle code competitions: data paths, offline packages, GPU/accelerator choice, kernel push workflow, time limits, and debugging common errors like TIMEOUT and NO_SCORE.
Ships in kaggle-tools. 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.
None: SKILL.md is the whole skill.
Code competitions re-run your saved notebook in a fresh, offline container on the
hidden test set. The #1 failure mode: a notebook that works interactively but fails
silently in the re-run. Run kt check <kernel_dir> (from kaggle-tools) before every push.
| What | Path |
|---|---|
| Competition data | /kaggle/input/competitions/<slug>/ or /kaggle/input/<slug>/ |
| Datasets (older layout) | /kaggle/input/datasets/<owner>/<slug>/ |
| Datasets (newer layout) | /kaggle/input/<slug>/ |
| Models | /kaggle/input/<model>/<framework>/<variation>/<version>/ |
| Writable | /kaggle/working/ only (plus /kaggle/tmp) |
The layout differs between script and notebook kernels and has changed over time.
Use kaggle_tools.env.competition_dir / dataset_dir, which try all layouts and fail
listing every path tried. Don't "fix" a vendored notebook's working paths to a newer
layout — that broke ROGII.
/kaggle/working/submission.csv (or the parquet the comp asks
for). Without it the "Submit to Competition" button stays disabled.kaggle_tools.submission.ProgressiveSubmission). Any later crash or timeout still
leaves a scoreable file. This rescued BirdCLEF after five consecutive NO_SCORE runs
caused by a silently changed scoring environment.df.iloc[i, 1:] = … loop was O(n²) and consumed
10–60 min in the re-run.sample_submission.csv (kt validate).KAGGLE_IS_COMPETITION_RERUN=1 is set; no internet; fresh environment.assert; wrap optional stages in try/except with a fallback.ImportError,
FileNotFoundError and "fallback" before submitting.Attach wheels as a dataset (or kernel_sources of a wheel-building notebook) and
install with pip install --no-index --no-deps /kaggle/input/.../*.whl
(kaggle_tools.env.install_offline_wheels, which raises when a wheel is missing).
Match versions to the Kaggle image (e.g. an OpenVINO IR built with 2026.0 failed on
Kaggle's 2025.4.1).
machine_shape is a P100 (sm_60). Kaggle's stock torch ≥ 2.10 ships
no sm_60 kernels → cudaErrorNoKernelImageForDevice on any CUDA op."machine_shape": "NvidiaTeslaT4" (the CLI --accelerator
flag did not stick; the metadata field does).device='cuda'; ship arrays/weights and re-fit or
load on the live device. CPU fallback for big in-context models can OOM-kill (SIGKILL is
not catchable) → skip the stage gracefully instead.notebook_limit≈17000 s; 28800 got the kernel killed).kaggle_tools.budget.TimeBudget).kaggle_tools.budget.TimeBudget) and keep
the last valid output (ProgressiveSubmission). If blending surviving members,
renormalize the correct per-finding weights and log omitted components.kt check notebooks/my-kernel/ # lint metadata + source
kaggle datasets version -p artifacts/ -m "..." # FIRST: kernels pin dataset versions at push
kaggle kernels push -p notebooks/my-kernel/
kaggle kernels status <user>/<slug> # poll until COMPLETE / ERROR
kaggle kernels output <user>/<slug> -p /tmp/out/ # always read the log on ERROR
# Submit the COMPLETE version from the CLI (works for code competitions, CLI 2.0, 2026-10):
kaggle competitions submit <comp-slug> -k <user>/<slug> -v <version> -f submission.csv -m "..."
When using -k, -v is required too. -f names the saved notebook's output file,
not a local CSV to upload. Record the version printed by kernels push and check
that version's completion and logs before submitting it; avoid overlapping pushes
when polling the latest kernel status. The notebook UI button still works.
See the Kaggle CLI implementation
(competition_submit_cli, competition_submit_code).
Or from Python: kaggle_tools.kernel.push / wait / output, then
parse_pushed_version + submit(competition, kernel_id, version, message).
kernels push starts a save-mode run; GPU runs consume GPU quota.
RSNA Knee 2026 runs encountered a 30 h weekly quota and a two-session GPU limit.
Check the account's current quota, reset countdown and concurrency limits in
Kaggle before scheduling work; these observations are not platform guarantees.
CPU-only preprocessing does not use GPU quota.multiprocessing.Pool
initializer raised NameError; the pool silently respawned workers forever and the
save-mode run sat on two T4s until cancelled by hand. Validate setup before starting
the pool. If initialization must happen in each worker, catch Exception, store
the failure in worker state, and have the task function raise it to the parent;
a Pool initializer's return value is discarded. Terminate and join the pool on
failure, and bound waits in the parent. See Python's Pool documentation.
For rehearsal runs, arm faulthandler.dump_traceback_later(limit, exit=True) and
cancel it in finally with faulthandler.cancel_dump_traceback_later() so a
successful run cannot be killed later. This uses a native watchdog thread; an
ordinary Python thread may be blocked by code holding the GIL. Forced exit skips
cleanup, so use an external process-group timeout when child processes must also
be killed. See faulthandler.
Helpers: kaggle_tools.runtime.watchdog(seconds) and
guarded_initializer(setup) + raise_if_init_failed() in the task function.glob("**/...", recursive=True) over /kaggle/input to find your weights:
the competition mount may sit under /kaggle/input/<slug>/ and a recursive walk of
~10^5 DICOMs took 9 minutes of the run. Skip competition mounts explicitly.Before submitting a new model, rehearse inference on a representative subset of
training inputs using the competition's test schema. For RSNA Knee, use e.g. ~64
studies: build a fake root with test.csv, the per-series CSV for those ids, and a
symlink test_series -> train_series. Select this root only through an explicit
rehearsal option; leave it disabled in the submitted notebook. Include large studies
and time setup separately from per-study work when estimating hidden-test runtime
(kaggle_tools.runtime.rehearsal_root builds the fake root).
Compare against the same ensemble run locally, not against OOF. Fold models were
trained on 4/5 of those studies, so a 5-fold average differs from OOF by up to ~0.7
per prediction; an automatic gate that compared to OOF blocked a correct submission
(RSNA Knee v3, later 0.940 LB). Against the local 5-fold average the kernel matched to
max |diff| 0.0099 (fp16 vs bf16).
Align sample ids and output columns and use a precision tolerance measured for your
pipeline; 0.0099 is an observation, not a universal threshold. This is a plumbing
and runtime check, not an unbiased accuracy estimate; keep OOF for model validation.
ids[part::n_parts]); shuffle it once with a
fixed seed if representative shards matter. Interleaving sorted ids is not random,
and variable study sizes require checking each shard's estimated bytes.curl --fail --location -C - with
an explicit output path and bounded retries. Resume only the same immutable file;
refresh expired URLs for that version. If HEAD is rejected, a Range: bytes=0-0
GET can reveal the total, but require HTTP 206 and a valid Content-Range; a server
may ignore Range. Stop on unsupported resume or a checksum mismatch.
See curl's resume options.
Helper: kaggle_tools.kernel.download_resumable(url, dest, expected_size=None, sha256=None);
shards: kaggle_tools.runtime.shard_ids(ids, part, n_parts, seed).kernel_sources are fine for static assets (wheels, tokenizer files, weights).dataset_sources won't mount.enable_internet: false, competition_sources set, T4 pinned if torch GPU.submission.csv written early and re-written after each stage.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub yassinealouini/kaggle-tools --plugin kaggle-tools9 skills in this plugin
/kaggle-audio-bioacousticsUse when working on Kaggle audio/bioacoustics competitions like BirdCLEF — row_id parsing, pretrained bioacoustic backbones (Perch, BirdNET), per-species probes, temporal models, mel spectrograms, CV/LB gap, rare and zero-sample species, CPU inference budget/kaggle-competition-playbookUse when starting, planning or steering any Kaggle competition — reading the metric, choosing CV, deciding which experiment to run next, interpreting CV/LB gaps, ensembling, and managing submission/GPU quota/kaggle-leaderboard-analysisCompare Kaggle public and private team positions, or plot an account's competition history as top percentages by year with readable paginated figures. Use for leaderboard shakeups, finishing positions, and competition progress reports./kaggle-llm-finetuningUse when fine-tuning LLMs (LoRA/QLoRA, SFT, GRPO) inside Kaggle competitions — TRL/PEFT setup, packing, completion-only loss, data quality, adapter submission format, GPU quota and 12 h kernel limits/kaggle-llm-reasoningUse when working on Kaggle LLM reasoning/inference competitions like AIMO — model choice, vLLM on H100, tool-integrated reasoning (TIR), self-consistency voting, answer extraction, inference-server API, time budget, offline tokenizer files/kaggle-llm-servingUse when an LLM inference notebook on Kaggle GPUs (4x L4, 2x T4, single 24 GB cards) is throughput-bound — tokens/s too low for the runtime limit, choosing tensor vs data parallel, fitting a 20-30B model on one 24 GB card, KV-cache or Mamba/GDN state limiting concurrency, MTP/speculative decoding depth, int4/fp8 weights or KV, vLLM patch stacks (HyperQwen, Merlin), or benchmarking serving configs on RunPod before spending Kaggle quotaOther plugins' skills for the same job