Automating a Full Kaggle Competition with Claude Code: An Auto‑Research Walkthrough

The author details how Claude Code can take over the entire Kaggle workflow—from data download and remote GPU training via SSH and tmux to Kaggle‑CLI submission—leaving only high‑level direction and final decision to the human.

AI Programming Lab
AI Programming Lab
AI Programming Lab
Automating a Full Kaggle Competition with Claude Code: An Auto‑Research Walkthrough

After a previous tweet about using Claude Code for Kaggle, the author presents a complete methodology using the AMIA Public Challenge 2026 (X‑ray disease detection) as a concrete example.

The workflow splits labor clearly: Claude Code writes code and makes low‑level decisions on a local Mac, while the human only defines the research direction and confirms key choices. A rented GPU cloud server handles training and inference, and the Kaggle CLI closes the submission loop.

To let Claude Code connect to the remote GPU without exposing passwords, the author runs ssh-copy-id once to install a public key, then adds an alias in ~/.ssh/config:

Host gpu
    HostName i-2.gpushare.com
    User root
    Port 54210
    IdentityFile ~/.ssh/id_ed25519

After this, commands such as ssh gpu "nvidia-smi" work without specifying the port.

Training data are downloaded directly on the server with the Kaggle CLI:

kaggle competitions download -c amia-public-challenge-2026

The local code is transferred via rsync using the custom port:

rsync -avz -e "ssh -p 54210" workspace/ gpu:/hy-tmp/workspace/

Remote training is managed inside a tmux session so that the process detaches from the SSH shell. Claude Code starts a background session, redirects logs to a file, and appends echo EXIT=$? to capture the exit status, enabling it to detect whether training finished or crashed.

Because Claude Code runs locally, the Mac must stay awake for continuous monitoring; the author recommends using caffeinate or keeping the lid open. Even if the Mac sleeps, the training on the server continues uninterrupted.

The author notes network quirks on some domestic cloud providers: direct access to GitHub and huggingface.co may fail, causing YOLO or timm weight downloads to hang. The workaround is to pre‑download weights from an hf‑mirror, place them on the server, and set HF_ENDPOINT to point to the mirror.

Once a baseline is established, Claude Code scans Kaggle code repositories and the leaderboard tab, then iteratively refines the solution based on the previous submission score. A special /goal command can set a target score, prompting Claude Code to keep optimizing until the target is reached or the best achievable score is obtained.

The final submission loop runs entirely through the Kaggle CLI: Claude Code selects the best candidate, the human gives a brief approval, the CLI submits, the leaderboard score is read back, and the cycle repeats.

The author reflects that the experience feels more like "auto‑research" than simple outsourcing. While effective for standard detection pipelines, the approach may struggle with data‑leakage competitions or heavily engineered tabular tasks. It is intended for readers with time and curiosity to explore the full automation pipeline.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AI automationSSHKaggletmuxGPU serverClaude Codeauto-research
AI Programming Lab
Written by

AI Programming Lab

Sharing practical AI programming and Vibe Coding tips.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.