Skip to main content

colabo

PyPI CI

Work on your project locally with Claude Code (or any editor), run it on a free Google Colab GPU.

colabo glues together two existing tools so you never think about them:

  • Google's official colab CLI allocates the VM and gives you SSH into it.
  • Mutagen keeps your project folder and /content/<project> on the VM in two-way sync, continuously.

Edit a file on your laptop, it is on the GPU box a second later. A script writes to outputs/, it is back on your laptop a second later. Claude Code just calls colabo run python train.py.

┌──────────────── laptop ────────────────┐        ┌────────── Colab VM (T4/L4/A100) ──────────┐
│ Claude Code ── edits ──> ./my-project  │ ⇄ sync │  /content/my-project                       │
│                       colabo run ──────┼── ssh ─┼─> python train.py  ──writes──> outputs/    │
└────────────────────────────────────────┘        └───────────────────────────────────────────┘

Install

macOS or Linux (the colab CLI does not support Windows). Python 3.12+.

uv tool install colabo          # or: pipx install colabo   (latest dev: uv tool install git+https://github.com/khursanirevo/colabo)
brew trust mutagen-io/mutagen && brew install mutagen-io/mutagen/mutagen   # macOS; Linux: https://mutagen.io/documentation/introduction/installation
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519                     # Colab rejects RSA keys
colab sessions                                                  # one-time Google login (follow the prompt)

colabo doctor tells you what is still missing.

Use

cd my-project
colabo init --gpu T4          # writes colabo.toml, mutagen.yml, a CLAUDE.md section, an ssh host `colab-my-project`
colabo up                     # allocates the VM on first use, starts the sync
colabo run python train.py    # runs in /content/my-project on the GPU; outputs sync back
colabo down                   # stop sync, release the VM  (idle VMs burn compute units!)

Other commands:

Command What it does
colabo status VM state, ssh connection, sync state
colabo ssh interactive shell in the remote project dir
colabo exec file.py run a local file in the persistent Colab kernel (state survives between calls)
colabo install torch pip-install on the VM
colabo push / colabo pull [dir] one-shot rsync if you do not want Mutagen running
colabo down --keep stop sync but keep the VM
colabo skill (re)install the Claude Code skills
colabo statusline install / uninstall add/remove the Colab segment in the Claude Code statusline

GPUs: T4 (free tier), L4, G4, A100, H100, TPUs v5e1, v6e1, or cpu. Anything beyond T4 and --high-mem need Colab Pro/Pro+.

Claude Code

colabo init appends a section to your project's CLAUDE.md and installs two skills into ~/.claude/skills/: colabo (this workflow) and Google's colab-operator (the raw colab CLI). After that you can just say:

train for one epoch on colab and show me the loss curve

and Claude Code will colabo up, colabo run ..., read outputs/, and (if you ask) colabo down.

Statusline

colabo init also adds a segment to the Claude Code statusline so you always see whether a VM is running (and burning compute units):

Fable | 📁my-project | 🔀main | ████░░░░░░ 40% | ⚡colab my-project·T4 ⇅ · 12.3 CU · 1.07/hr
                                                         │               │  │         └ current burn rate
                                                         │               │  └ compute-unit balance
                                                         │               └ Mutagen sync running
                                                         └ session name · accelerator ("off" when no VM)

If you already have a statusline command, colabo chains after it (your output first, the Colab segment appended to the first line). colabo statusline uninstall restores the previous command exactly. Session state comes from the colab CLI's local state file (instant); the balance comes from colab usage, refreshed in the background every two minutes so the statusline never blocks. Skip it with colabo init --no-statusline.

How it works, and the gotchas it handles

  • SSH host. colabo init adds a Host colab-<session> block to ~/.ssh/config whose ProxyCommand is colab ssh --proxy-mode. Connecting to that host auto-creates the Colab session with the requested accelerator. VS Code Remote-SSH and JetBrains Gateway work against the same host.
  • One SSH connection per runtime. Colab returns HTTP 429 on a second connection. Mutagen holds one open, which would block every other ssh. The host block enables ControlMaster, so Mutagen, rsync and colabo run all share a single multiplexed connection. If you ever see 429: ssh -O exit colab-<session> then colabo up.
  • Only ed25519/ecdsa keys are accepted by the Colab SSH endpoint.
  • Ephemeral VM. Everything outside the synced tree (pip packages, /content/*) disappears at colabo down or when Colab reclaims the runtime. Keep installs in a requirements.txt and run colabo run pip install -r requirements.txt after up.
  • Big files are not synced. data/, checkpoints/, *.pt, *.safetensors, *.ckpt are ignored by default (edit mutagen.yml). Move them with colab download -s <session> REMOTE LOCAL, or mount Drive with colab drivemount -s <session>.
  • Session state. colabo.toml holds the project name, session name, accelerator and remote path. The colab CLI keeps its own state in ~/.config/colab-cli/.

Alternatives

  • colab-persist: same CLI underneath, adds Drive checkpoints and an MCP server.
  • claude-colab: Flask + Cloudflare tunnel inside a notebook, exposes GPU tools to Claude Code over MCP. No directory sync.
  • ali/claude-colab: runs Claude Code inside the Colab VM.

Releasing

Bump version in pyproject.toml, commit, then tag: git tag v0.1.1 && git push --tags. The publish workflow builds and uploads to PyPI through trusted publishing (no tokens in the repo).

Development

uv sync --extra dev
uv run pytest
uv run ruff check .

Tests are offline (they fake the colab and mutagen binaries). This repo dogfoods itself: examples/gpu_check.py is a smoke test you can colabo run.

MIT.

Metadata

Release files for colabo 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for colabo 0.1.0
File Size Uploaded Provenance Actions
colabo-0.1.0.tar.gz 85.0 kB Without provenance Details for colabo-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for colabo 0.1.0
File Interpreter ABI Platform Actions
colabo-0.1.0-py3-none-any.whl Python 3 none any Details for colabo-0.1.0-py3-none-any.whl

Total release size: 102.3 kB

Release files / colabo-0.1.0.tar.gz

Download URL colabo-0.1.0.tar.gz
Size 85.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ef2ad139af82ef160525c8c4215d383daa48696520a4861ad24be7a46648fc7d
BLAKE2b-256 checksum
How to use checksums
9e706c36f5345d1cc117d0191c149e5957351b285d7cccb0fea68fd6bd0d2e09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.9

Release files / colabo-0.1.0-py3-none-any.whl

Download URL colabo-0.1.0-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd31cbd1d9a9be84c7478d5056258f67e91b2868ddcfe5aeceff67b33443a7c1
BLAKE2b-256 checksum
How to use checksums
5047fc6403ebf5279559bbbf95a1980b514445429672164e7dffc96786e8d031
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.9

Security for colabo 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page