From mise-toolkit
GitHub Codespaces specifics for mise — prebuilds, repo secrets, image caching, free-tier vs paid considerations, and what goes in onCreateCommand vs postCreateCommand. Use when setting up Codespaces for a project with mise.
npx claudepluginhub ray-manaloto/claude-code-marketplace --plugin mise-toolkitThis skill uses the workspace's default tool permissions.
Codespaces is devcontainers-as-a-service on GitHub. Everything in `mise-devcontainer-patterns` applies; this skill covers the Codespaces-specific bits.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Guides code writing, review, and refactoring with Karpathy-inspired rules to avoid overcomplication, ensure simplicity, surgical changes, and verifiable success criteria.
Share bugs, ideas, or general feedback.
Codespaces is devcontainers-as-a-service on GitHub. Everything in mise-devcontainer-patterns applies; this skill covers the Codespaces-specific bits.
A "prebuild" is a nightly (or on-push) job that runs your devcontainer's onCreateCommand and snapshots the result. When a developer creates a codespace, GitHub starts from the prebuild snapshot instead of running onCreateCommand from scratch.
Without prebuilds: mise install runs on every codespace create. For a project with 5 tools, that's 2-5 minutes of "starting codespace..." every time.
With prebuilds: mise install has already run during the prebuild. Codespace starts in 10-30 seconds.
The cost: prebuilds consume GitHub Actions minutes and storage. For active projects this is well worth it; for dormant forks it's not.
Prebuilds are enabled in Settings → Codespaces → Set up prebuild on the repo page. You pick:
main, optionally release/*).There's no .yaml file for this — it's entirely a UI setting. The repo needs admin rights.
If you want cron-style prebuilds, add a workflow:
# .github/workflows/codespaces-prebuilds.yml
name: Codespaces Prebuilds
on:
schedule:
- cron: '0 6 * * 1-5' # weekdays 6am UTC
workflow_dispatch:
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- run: gh api --method POST /repos/${{ github.repository }}/codespaces/prebuilds
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Codespaces secrets work differently from regular repo secrets:
In the devcontainer, secrets show up as regular env vars. Reference them in mise.toml:
[env]
DATABASE_URL = { required = "Needs DATABASE_URL set via Codespaces secrets" }
GITHUB_TOKEN = { value = "{{env.GITHUB_TOKEN}}", redact = true }
Don't commit .env files to the repo and source them — use Codespaces secrets. mise's redact = true makes the values invisible in mise env output, but secrets are the primary protection.
As of this writing, personal accounts get 120 core-hours/month free. Prebuilds, active codespace time, and storage all count.
For free-tier sustainability:
For organizations, Codespaces billing is per-user and can escalate. Have a billing conversation before rolling out widely.
The prebuild runs onCreateCommand on a fresh container with no source code mounted. The source comes in later during the actual codespace create. This means:
onCreateCommand — it only needs mise.toml + mise.lock, which are checked out before onCreate runs.postCreateCommand — npm ci, bundle install, cargo fetch, etc.updateContentCommand for steps that should rerun when the user pulls new source (without a full rebuild).Codespaces supports per-user dotfiles: you point it at your dotfiles repo, and it runs your install.sh in every codespace. Great place to put:
~/.config/mise/config.toml).Do not put project-specific mise tools in dotfiles — that belongs in the project's mise.toml.
docker-in-docker feature.mise-devcontainer-patterns — the underlying devcontainer.json that Codespaces uses.mise-trust-and-security — why MISE_TRUSTED_CONFIG_PATHS matters in hosted environments.mise-ci-github-actions — for CI, not Codespaces. They're siblings, not substitutes.docs.github.com/en/codespaces./mise-codespaces-prebuild — generates the devcontainer.json + prebuild workflow.