cd /news/ai-tools/claude-sh · home topics ai-tools article
[ARTICLE · art-130471] src=gist.github.com ↗ pub= topic=ai-tools verified=true sentiment=· neutral

claude.sh

A developer published a Bash launcher script, claude.sh, that routes Anthropic's Claude Code CLI between Google Vertex AI and an internal "dogfood" AI gateway. The script selects a route via the first argument, expands shorthand flags such as -c, -r, and -y into their full Claude Code equivalents, and passes any remaining arguments through to the CLI. It sets the appropriate environment variables for each backend, unsetting Vertex-specific settings when using the gateway, and defaults to the dogfood route.

by read2 min views2 publishedSep 15, 2026

| | #!/usr/bin/env bash | | | # claude launcher — route to either Vertex or the dogfood gateway. | | | # Usage: | | | # ./claude <route> [shortcuts...] [extra claude args...] | | | # | | | # Routes: | | | # vertex route via Google Vertex | | | # dogfood route via dogfood AI gateway (default) | | | # |

|  | # Shortcuts (expand to claude flags; combine freely, any order): | 
|  | # -c \| continue \| --continue -> --continue | 
|  | # -r \| resume \| --resume -> --resume | 
|  | # -y \| yolo \| dangerous -> --dangerously-skip-permissions | 

| | # | | | # Anything else is passed straight through to claude. | | | # | | | # Examples: | | | # ./claude dogfood -c -y # gateway, continue last, skip permissions | | | # ./claude vertex resume # vertex, pick a session to resume | | | # ./claude -c # default route (dogfood), continue | | | set -euo pipefail | | | DEFAULT_ROUTE="dogfood" |

|  | # --- Vertex settings --- | 
|  | VERTEX_PROJECT_ID="<INSERT_ME>" | 

| | VERTEX_REGION="global" |

|  | VERTEX_MODEL="claude-sonnet-4@20250514" | 
|  | # --- Dogfood gateway settings --- | 
|  | GW_BASE_URL="<INSERT_HERE>" | 
|  | GW_API_KEY="<INSERT_HERE>" | 
|  | # --- Route: first arg if it names one, else default --- | 

| | route="$DEFAULT_ROUTE" |

|  | case "${1:-}" in | 
|  | vertex\|dogfood) route="$1"; shift ;; | 

| | esac |

|  | # --- Expand shortcuts, pass everything else through --- | 
|  | claude_args=() | 

| | for arg in "$@"; do | | | case "$arg" in |

|  | -c\|continue\|--continue) claude_args+=(--continue) ;; | 
|  | -r\|resume\|--resume) claude_args+=(--resume) ;; | 
|  | -y\|yolo\|dangerous\|--dangerously-skip-permissions) | 
|  | claude_args+=(--dangerously-skip-permissions) ;; | 
|  | *) claude_args+=("$arg") ;; | 

| | esac | | | done | | | case "$route" in | | | vertex) | | | export CLAUDE_CODE_USE_VERTEX=1 | | | export ANTHROPIC_VERTEX_PROJECT_ID="$VERTEX_PROJECT_ID" | | | export CLOUD_ML_REGION="$VERTEX_REGION" | | | export ANTHROPIC_MODEL="$VERTEX_MODEL" | | | export ANTHROPIC_SMALL_FAST_MODEL="$VERTEX_MODEL" | | | unset ANTHROPIC_BASE_URL ANTHROPIC_API_KEY |

|  | echo ">> route: VERTEX (project=$VERTEX_PROJECT_ID region=$VERTEX_REGION)" >&2 | 
|  | ;; | 

| | dogfood) | | | # unset (not ""), so Claude Code doesn't treat Vertex as enabled | | | unset CLAUDE_CODE_USE_VERTEX ANTHROPIC_VERTEX_PROJECT_ID CLOUD_ML_REGION | | | unset ANTHROPIC_MODEL ANTHROPIC_SMALL_FAST_MODEL | | | export ANTHROPIC_BASE_URL="$GW_BASE_URL" | | | export ANTHROPIC_API_KEY="$GW_API_KEY" |

|  | echo ">> route: DOGFOOD gateway" >&2 | 
|  | ;; | 

| | esac | | | exec claude "${claude_args[@]}" |

── more in #ai-tools 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/claude-sh] indexed:0 read:2min 2026-09-15 ·