Skip to content

Instantly share code, notes, and snippets.

@LeoVS09
Last active March 4, 2026 06:10
Show Gist options
  • Select an option

  • Save LeoVS09/242bf4852c118e1cf3500ee1a9ce5197 to your computer and use it in GitHub Desktop.

Select an option

Save LeoVS09/242bf4852c118e1cf3500ee1a9ce5197 to your computer and use it in GitHub Desktop.
Launch Docker sandbox for claude code
#!/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
@LeoVS09
Copy link
Author

LeoVS09 commented Feb 26, 2026

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment