Skip to content

Instantly share code, notes, and snippets.

@costa
Last active May 25, 2026 14:28
Show Gist options
  • Select an option

  • Save costa/d9b64547cc4d94a0c36716e7b3436803 to your computer and use it in GitHub Desktop.

Select an option

Save costa/d9b64547cc4d94a0c36716e7b3436803 to your computer and use it in GitHub Desktop.
Claude.AI (a LLM-genAI) "claude-code" docker (restricted) runner script -- to be run in a project root directory
#!/bin/bash -e
cwd="$( pwd )"
test -t 0 && tty_opt=t
docker run --rm -i$tty_opt -w "$cwd" -v "$cwd:$cwd" -v "$HOME/.claude:/root/.claude" -v "$cwd/node_modules" "$@" node npx -y @anthropic-ai/claude-code
@costa
Copy link
Copy Markdown
Author

costa commented Feb 10, 2026

$ curl -o /usr/local/bin/claude https://gist.githubusercontent.com/costa/d9b64547cc4d94a0c36716e7b3436803/raw/b6fd1bc76a3c476a8d3f1dbc1a97be1199a8a15d/claude; chmod +x /usr/local/bin/claude

@costa
Copy link
Copy Markdown
Author

costa commented Mar 6, 2026

consider another option for the command line above:
docker run --rm -i$tty_opt -v "$cwd:$cwd" -w "$cwd" -e "CLAUDE_CONFIG_DIR=$cwd/.claude" node npx -y @anthropic-ai/claude-code "$@"

@costa
Copy link
Copy Markdown
Author

costa commented Apr 5, 2026

--resume in the command line -- or just /resume inside

@costa
Copy link
Copy Markdown
Author

costa commented May 22, 2026

Just the one-liner for the proj dir isolation:
$ docker run --rm -it -v "$(pwd):$(pwd)" -w "$(pwd)" -e "CLAUDE_CONFIG_DIR=$(pwd)/.claude" node npx -y @anthropic-ai/claude-code

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