4/8/2026 at 7:34:54 AM
I don't understand why I keep seeing posts like this, but nobody appears to know that DevContainers exist.In a Jetbrains IDE, for example, you check a devcontainer.json file into your repository. This file describes how to build a Docker image (or points to a Dockerfile you already have). When you open up a project, the IDE builds the Docker image, automatically installs a language-server backend into it, and launches a remote frontend connected to that container (which may run on the same or a different machine from where the frontend runs).
If you do anything with an AI agent, that thing happens inside the remote container where the project code files are. If you compile anything, or run anything, that happens in the container too. The project directory itself is synced back to your local system but your home directory (and all its credentials) are off-limits to things inside the container.
It's actually easier to do this than to not, since it provides reusable developer tooling that can be shared among all team members, and gives you consistent dependency versions used for local compilation/profiling/debugging/whatever.
DevContainers are supported by a number of IDEs including VSCode.
You should be using them for non-vibe projects. You should DEFINITELY be using them for vibe projects.
by Borealid
4/8/2026 at 4:51:18 PM
Keep in mind that VSCode’s own security story is beyond poor. Even if the container runtime perfectly contains the container, VSCode itself is a hole you could drive a truck through.by amluto
4/8/2026 at 11:40:43 AM
I love JetBrains and they’ve gotten better with using devcontainers but they’re still kind of flaky at times. I love using devcontainer too, just wanted to note that.I found cloning the repo when creating the devcontainer works best in JetBrains for some reason and I hard code the workspace directory so it’s consistent between JetBrains and vscode
by hk1337
4/8/2026 at 7:45:01 AM
Yeah, it's easy to vibecode and review a docker sandbox, too. If you run containers with --runtime=runsc
--cap-drop=ALL
--security-opt no-new-privileges:true
it's pretty tight. That's how I use coding agents, FWIW.
by AlexCoventry
4/8/2026 at 8:09:27 AM
The main Claude Code GitHub repo even has a Devcontainer config:https://github.com/anthropics/claude-code
It's a great starting point, and can be customized as needed. With the devcontainer CLI, you can even use it from a terminal, no GUI/IDE required.
by arcanemachiner
4/8/2026 at 10:21:04 AM
Is there a guide on getting it working with a devcontainer on the command line?by xnorswap
4/8/2026 at 8:41:31 AM
Has anyone figured out a good way to use (neo)vim with devcontainers?by mr_mitm
4/8/2026 at 3:57:17 PM
I use vim with docker compose all the time: Set up the compose file to bind-mount the repo inside the container, so you can edit files freely outside it, and add a convenience "make shell" that gets you inside the container for running commands (basically just "docker compose exec foo bash").It sounds like if you make devcontainers point at an existing Dockerfile it should be easy to make these work together, so you and teammates both use the same configuration. I haven't used devcontainers though.
by Izkata
4/8/2026 at 10:51:41 AM
I personally just use Vim directly in a dedicated development VM that I SSH into. I can always spin up a new one if something goes astrayby datsci_est_2015
4/8/2026 at 11:21:50 AM
I'd prefer containers, because they are more light weight and I'm not too concerned about kernel exploits or other sandbox escapes. Configuring a container per project brings me right back to something like devcontainer. But I haven't figured out a good way to incorporate that into my vim/tmux workflow.by mr_mitm
4/8/2026 at 12:19:09 PM
Hmm, maybe I misunderstood the point of the original comment. I thought the OP was suggesting using containers to isolate resources for development vs personal computing, for which I use a VM. But VMs don’t play nicely with IDEs (hence devcontainers).by datsci_est_2015
4/8/2026 at 9:26:42 AM
haven't tried it but amitds1997/remote-nvim.nvimI need something like that though that's one of the thing that pains me the most while trying to use vim/nvim for dev
by Oxodao
4/8/2026 at 9:28:14 AM
[dead]by implicitcoder
4/8/2026 at 12:31:26 PM
I used to use sealtbelts for sandbox, i found it consumes way more tokens when sandboxed.Now, i run YOLO and haven't had any issue and my subscription lasts much longer with less token consumption!
by faangguyindia
4/8/2026 at 4:19:17 PM
How/why did it consume more tokens?by semanticc
4/8/2026 at 4:27:30 PM
Well, thing is I ask it doesn't things where sandbox fails.And then it has to bypass sandbox to run those command with elevated permission.
This double tripe boosts token usage.
I don't think average developer workflow can be really limited to a workspace. You'll need commands which touch your system or require more privilege
by faangguyindia