sha256:cf4cf54bb4f88391d83aba1f0a0506fd77ec4068b81cb45626d88b8d8f30ac0c
Last pushed
16 days by fredrbus
Type
Sandbox Kit
Manifest digest
sha256:cf4cf54bb4f88391d83aba1f0a0506fd77ec4068b81cb45626d88b8d8f30ac0c
schemaVersion: "2"
kind: sandbox
name: claude-kit
version: 0.0.1
displayName: Claude Code (claude-kit)
description: Claude Code with Temurin JDK, Maven, pnpm and the mattpocock-skills, fredrbus and skins plugins.
sandbox:
image: docker.io/fredrbus/claude-kit-image:0.0.1
entrypoint:
- claude
command:
default:
- --dangerously-skip-permissions
interactive:
- --dangerously-skip-permissions
agentInstructions:
filename: CLAUDE.md
content: |
## Claude Code: Environment Persistence
The `CLAUDE_ENV_FILE` environment variable is set to `/etc/sandbox-persistent.sh`. It is sourced before every Bash tool call, so `export` statements appended to it persist across commands.
**NEVER add shell completion scripts to `/etc/sandbox-persistent.sh`** (for example NVM's `bash_completion` or SDKMAN's `bash_completion.sh`). They rely on `COMP_WORDS`, `COMP_CWORD` and `COMPREPLY`, which only exist during tab completion, and sourcing them before every command makes all Bash output silently disappear. If that happens, remove the completion lines, restart the session and check with `echo "test"`.
## claude-kit
- Temurin JDK 25 (`JAVA_HOME=/opt/temurin`), Maven (`mvn`, installed in `/opt/maven`), Node.js, pnpm and git are available.
- Maven Central and the npm registry are reachable; other package registries may be blocked by the sandbox network policy.
- The time zone is `Europe/Oslo` (`TZ`, set via `/etc/claude-code/managed-settings.json` and `/etc/profile.d/claude-kit-env.sh`).
- The Claude Code plugins `mattpocock-skills`, `fredrbus` and `skins` are pre-installed and enabled via `/etc/claude-code/managed-settings.json`.
permissions:
network:
allow:
- api.anthropic.com
- console.anthropic.com
- claude.ai
- mcp-proxy.anthropic.com
- platform.claude.com
- downloads.claude.ai
- claude.com
- code.claude.com
- bridge.claudeusercontent.com
- archive.ubuntu.com
- security.ubuntu.com
- ports.ubuntu.com
- download.docker.com
- repo.maven.apache.org
- repo1.maven.org
- registry.npmjs.org
- github.com
- api.github.com
- codeload.github.com
- raw.githubusercontent.com
volumes:
- path: /home/agent/.claude/projects
size: 2g
- path: /home/agent/.claude/sessions
size: 512m
- path: /home/agent/.claude/todos
size: 512m
- path: /home/agent/.claude/shell-snapshots
size: 512m
- path: /home/agent/.claude/statsig
size: 512m
credentials:
- service: anthropic
apiKey:
name: ANTHROPIC_API_KEY
inject:
- domain: api.anthropic.com
header: x-api-key
format: '%s'
- domain: console.anthropic.com
header: x-api-key
format: '%s'
- domain: claude.ai
header: x-api-key
format: '%s'
- domain: mcp-proxy.anthropic.com
header: x-api-key
format: '%s'
oauth:
tokenEndpoint:
host: platform.claude.com
path: /v1/oauth/token
sentinels:
accessToken: sk-ant-oat01-proxy-managed
refreshToken: sk-ant-ort01-proxy-managed
credentialFile:
path: ~/.claude/.credentials.json
template: '{"claudeAiOauth":{"accessToken":"{{.AccessToken}}","refreshToken":"{{.RefreshToken}}","expiresAt":{{.ExpiresAt}},"scopes":{{.ScopesJSON}}}{{if .PrimaryApiKey}},"primaryApiKey":"{{.PrimaryApiKey}}"{{end}}}'
environment:
variables:
DISABLE_ERROR_REPORTING: "1"
DISABLE_TELEMETRY: "1"
IS_SANDBOX: "1"
setup:
install:
- command: |
set -e
ws="${WORKSPACE_DIR:-/}"
esc=$(printf '%s' "$ws" | sed 's/\\/\\\\/g; s/"/\\"/g; s/\t/\\t/g; s/\r/\\r/g')
projects="\"/\": { \"hasTrustDialogAccepted\": true }"
[ "$ws" = "/" ] || projects="$projects, \"$esc\": { \"hasTrustDialogAccepted\": true }"
printf '%s\n' "{
\"bypassPermissionsModeAccepted\": true,
\"hasCompletedOnboarding\": true,
\"projects\": { $projects }
}" > /home/agent/.claude.json
chown agent:agent /home/agent/.claude.json
user: "0"
description: Seed Claude bypass/trust flags (root; overwrites image-shipped file)
- command: |
set -e
mkdir -p /home/agent/.claude
HELPER=''
if [ "${SBX_CRED_ANTHROPIC_MODE:-none}" != none ]; then
HELPER=' "apiKeyHelper": "echo proxy-managed",
'
fi
printf '%s' "{
\"themeId\": 1,
\"alwaysThinkingEnabled\": true,
${HELPER} \"permissions\": { \"defaultMode\": \"bypassPermissions\" },
\"bypassPermissionsModeAccepted\": true,
\"skipDangerousModePermissionPrompt\": true
}
" > /home/agent/.claude/settings.json
user: agent
description: Seed Claude settings.json from SBX_CRED_ANTHROPIC_MODE
- command: |
set -e
[ -n "$MCP_GATEWAY_URL" ] || exit 0
export PATH="$HOME/.local/bin:$HOME/.claude/local:$PATH"
claude mcp add mcp-gateway "$MCP_GATEWAY_URL" \
--transport http \
--scope user \
--header "Authorization: Bearer $MCP_SENTINEL_TOKEN_NAME" || true
user: agent
description: Register the sandbox MCP gateway with claude (install-time, race-free)
startup:
- command:
- sh
- -c
- chown -R agent:agent /home/agent/.claude/projects /home/agent/.claude/sessions /home/agent/.claude/todos /home/agent/.claude/shell-snapshots /home/agent/.claude/statsig 2>/dev/null || true
user: "0"
description: Re-own claude session-state volume mount roots to agent (block-volume mkfs trap)
- command:
- sh
- -c
- '{ command -v apt-get && apt-get update -qq -y || true; } >/dev/null 2>&1 </dev/null &'
user: root
description: Update apt package cache in background
- command:
- sh
- -c
- |
set -e
[ -n "$MCP_GATEWAY_URL" ] || exit 0
export PATH="$HOME/.local/bin:$HOME/.claude/local:$PATH"
claude mcp add mcp-gateway "$MCP_GATEWAY_URL" \
--transport http \
--scope user \
--header "Authorization: Bearer $MCP_SENTINEL_TOKEN_NAME" || true
user: agent
description: Register the sandbox MCP gateway with claude (startup fallback)