Settings

Theme

Show HN: Docker container for Claude Code with complete host isolation

github.com

2 points by nezhar 5 months ago · 5 comments · 1 min read

Reader

I created a Docker container that packages Claude Code in a completely isolated environment. This solves the problem of wanting to try AI development tools without installing them directly on your system.

Credentials are persisted via bind mounts, with clean workspace access and easy removal when done experimenting. Perfect for developers who are curious about AI coding assistance but cautious about system-wide installations.

The container maintains all the functionality of Claude Code while keeping your host system pristine. Just docker run, authenticate once, and start coding with AI help. Remove the container later and there are no traces left behind.

The README on GitHub has examples for easy integration into existing projects. I welcome suggestions and feedback!

roscas 5 months ago

Suggestion, to use --network=host so you can control to where it connects.

But if it is "a completely isolated environment" why does it need to login and get a token? It defeats isolation.

This should work like any other model, like we do with Ollama, download a model and it runs strict local with no network connections or tokens.

  • nezharOP 5 months ago

    You still need to connect to Anthropic and obtain an authorization token.

    The isolation here refers to the workspace. Since you run the CLI in a container, the process can only access what you have mapped inside. This is helpful if you want to avoid issues like this: https://hackaday.com/2025/07/23/vibe-coding-goes-wrong-as-ai...

    • roscas 5 months ago

      Ok. Thanks for the clarification. Still a good project, and many people like to use online services.

      I prefer local models. All I use and used on the local model could be on an online, no secrets here. The speed is more than acceptable for a low end cpu+gpu.

      I stil use Perplexity sometimes for more complex questions.

  • rreinold927 5 months ago

    This would be ideal if claude code supported local models, but is not the case right now

rreinold927 5 months ago

This is a great way for security conscious developers to start using Claude

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection