Last active
March 4, 2026 06:10
-
-
Save LeoVS09/242bf4852c118e1cf3500ee1a9ce5197 to your computer and use it in GitHub Desktop.
Launch Docker sandbox for claude code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # Host repo directory = current directory | |
| REPO_DIR="$(pwd)" | |
| CONTAINER_DIR="/workspace" | |
| IMAGE="node:24" | |
| # Optional: pass a command to run inside the container. | |
| # If no command is provided, start an interactive shell. | |
| if [ "$#" -gt 0 ]; then | |
| CMD=("$@") | |
| else | |
| CMD=("bash") | |
| fi | |
| docker run --rm -it \ | |
| --name node24-dev \ | |
| --user "$(id -u):$(id -g)" \ | |
| --env ENABLE_LSP_TOOL=1 \ | |
| --mount "type=bind,src=${REPO_DIR},target=${CONTAINER_DIR}" \ | |
| --workdir "${CONTAINER_DIR}" \ | |
| "${IMAGE}" \ | |
| "${CMD[@]}" | |
| # Add this lines if want to share claude settings, and avoid to login second time | |
| # --mount "type=bind,src=${HOME}/.claude,target=/home/node/.claude" \ | |
| # --mount "type=bind,src=${HOME}/.claude.json,target=/home/node/.claude.json" \ | |
| # After launch run this, to install claude code | |
| # curl -fsSL https://claude.ai/install.sh | bash | |
| # Sometimes installation have bug, run this to fix it | |
| # export PATH="$HOME/.local/bin:$PATH" | |
| # launch claude code | |
| # claude | |
| # Install plugins | |
| # /plugin marketplace add NeoLabHQ/context-engineering-kit | |
| # /plugin install sdd@NeoLabHQ/context-engineering-kit | |
| # /plugin install sadd@NeoLabHQ/context-engineering-kit | |
| # Run in order to modify settings, for example disable compression | |
| # /settings | |
| # Launch claude code in YOLO mode, without asking for permissions | |
| # claude --dangerously-skip-permissions | |
| # To enable typescript LSP install following dependencies | |
| # npm config set prefix /home/node/local && export PATH="/home/node/local/bin:$PATH" | |
| # npm install -g typescript-language-server typescript | |
| # then type `/plugin` and search for `typesript-lsp`, and enable it | |
| # restart claude |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minimal script to securely launch Claude code without the need to approve permissions.
Requires Docker to be installed.
Works on linux, probably works on Mac also