Dev Container Generator

Spin up a devcontainer.json tuned for Claude Code.

  • $39 Free
  • 60 sec
  • No signup
1

Pick your language and tooling

2

Toggle the features you need

3

Copy the devcontainer.json into .devcontainer/

You get: A devcontainer.json tuned for your stack and Claude Code.

Your container

Dev container features

Claude Code

VS Code extensions

Networking

.devcontainer/devcontainer.json

{
  "name": "claude-code-dev",
  "image": "mcr.microsoft.com/devcontainers/typescript-node:22",
  "features": {
    "ghcr.io/devcontainers/features/git:1": {},
    "ghcr.io/devcontainers/features/github-cli:1": {}
  },
  "customizations": {
    "vscode": {
      "extensions": [
        "eamodio.gitlens",
        "esbenp.prettier-vscode",
        "dbaeumer.vscode-eslint"
      ]
    }
  },
  "forwardPorts": [
    3000
  ],
  "postCreateCommand": "npm install || true && npm install -g @anthropic-ai/claude-code",
  "remoteUser": "node"
}

Save this at .devcontainer/devcontainer.json, then reopen the folder in a container from VS Code or a Codespace. Confirm the exact image tags exist for your registry before committing.

Why run Claude Code in a dev container

A dev container is a reproducible, disposable environment defined by a single devcontainer.json file. Everyone who opens the repo gets the exact same toolchain - same language version, same CLI tools, same extensions - without touching their own machine. For Claude Code specifically there are two big wins: the model runs inside an isolated container instead of your real filesystem, and the whole team shares one setup so 'works on my machine' stops being a debugging step.

The generator above builds that file for you. Pick a base image, choose a language version, toggle the dev container features and VS Code extensions you want, and optionally have Claude Code install itself the moment the container is created. The output is valid devcontainer.json you drop into a .devcontainer folder.

The pieces of a devcontainer.json

  • image - the prebuilt container to start from. The Microsoft dev container images cover Node, Python, and multi-language stacks with sane defaults.
  • features - reusable add-ons published as OCI artifacts. Adding the git, github-cli, or docker-in-docker feature is a one-line entry instead of a custom Dockerfile.
  • customizations.vscode.extensions - the editor extensions that auto-install inside the container so every teammate gets the same linting and tooling.
  • forwardPorts - ports the container exposes to your host, so a dev server inside the container is reachable in your browser.
  • postCreateCommand - a command that runs once after the container is built, ideal for installing dependencies and Claude Code itself.
  • remoteUser - the user the tools run as. Running as a non-root user like 'node' is the safer default.

Isolation is the point

Running Claude Code inside a container means the tools it invokes act on the container filesystem, not your host. Combined with a tight permissions block in settings.json, this gives you two layers of blast-radius control.

Installing Claude Code on container create

When you toggle the Claude Code install option, the generator appends the global npm install to the postCreateCommand. That means the very first time the container spins up, it installs your dependencies and then pulls Claude Code, so it is ready to run the moment the container finishes building. You will still authenticate on first use, but the binary is already there.

Features versus a custom Dockerfile

For most projects, base image plus features is all you need and it keeps the config declarative and short. Reach for a custom Dockerfile only when you need system packages or a build step that no published feature covers. The two approaches compose: you can point at a Dockerfile and still layer features on top. Starting from features first keeps your setup readable and easy for teammates to reason about.

How to use the output

  1. Create a .devcontainer folder in your project root.
  2. Save the generated JSON as .devcontainer/devcontainer.json.
  3. In VS Code, run 'Dev Containers: Reopen in Container', or open the repo in a GitHub Codespace.
  4. Wait for the postCreateCommand to finish - that is when dependencies and Claude Code install.
  5. Run claude in the integrated terminal and authenticate on first use.

Keeping it reproducible over time

Pin your image tags and feature versions rather than floating on latest, so a rebuild six months from now produces the same environment. Commit the devcontainer.json so the setup travels with the repo. When you upgrade a language version, do it in the file and let everyone rebuild - that single-source-of-truth discipline is the whole reason dev containers exist.

Frequently asked questions

  • Where does devcontainer.json go?

    It lives at .devcontainer/devcontainer.json in your project root. Some setups also allow a single .devcontainer.json at the root, but the folder form is the convention and supports extra files like a Dockerfile.

  • How do I open the container?

    In VS Code with the Dev Containers extension, run 'Reopen in Container' from the command palette. On GitHub, just open the repo in a Codespace and it reads the same file automatically.

  • Will Claude Code be installed automatically?

    If you toggle the install option, the generator adds the global install to postCreateCommand, so Claude Code is pulled the first time the container builds. You still authenticate on first run.

  • What are dev container features?

    Features are reusable, versioned add-ons like git, the GitHub CLI, or docker-in-docker. You reference them by their registry path and they install into the container without a custom Dockerfile.

  • Can I run Claude Code as a non-root user?

    Yes, and you should. On the Node images the generator sets remoteUser to node, so the tools run without root. This is the safer default and pairs well with a locked-down permissions block.

  • Do I need Docker installed to use this?

    Locally, yes - dev containers run on Docker. In a GitHub Codespace the container runs in the cloud, so you only need a browser or the VS Code Codespaces extension.

Liked this tool? The club is the next step.

Join Claude Code Club for $9/month. 650+ lessons, weekly updates, and the workflows behind every tool on this site.

  • No experience needed
  • Cancel anytime
  • Updated weekly