Import claude-code-switcher from the Windows build

Source of truth so far has been c:\Users\smoido\projects\cli on the Windows
box, which has no git history of its own. This is that tree copied verbatim over
SSH, minus dist/ - the PowerShell build, the POSIX port under linux/, and the
presets both share.

Recorded as its own commit so that everything after it is a reviewable diff
rather than an undifferentiated first drop.
This commit is contained in:
smoido
2026-08-30 21:05:48 +03:00
commit 112068314c
20 changed files with 4994 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
# >>> claude-mode >>>
# Installed by claude-code-switcher. Do not edit between the markers;
# re-run install.sh instead.
#
# `claude-mode` itself is a normal executable on PATH, so nothing here is needed
# to use it. This block exists only for the wrapper below.
#
# settings.json is the single source of truth for gateway config, so any
# inherited copy of these variables is stripped before launch: a stale
# ANTHROPIC_API_KEY would silently bypass the gateway, and stale
# ANTHROPIC_BASE_URL / *_MODEL values would break native Anthropic auth. Only
# the child process is affected - the rest of your shell is untouched.
claude() {
local real
real="$(command -v claude 2>/dev/null)"
if [ -z "$real" ] || [ "$real" = "claude" ]; then
# `command -v` resolved to this function; find the real binary on PATH.
real="$(type -P claude 2>/dev/null)"
fi
if [ -z "$real" ]; then
echo "claude: not found on PATH" >&2
return 127
fi
env -u ANTHROPIC_API_KEY \
-u ANTHROPIC_AUTH_TOKEN \
-u ANTHROPIC_BASE_URL \
-u ANTHROPIC_DEFAULT_OPUS_MODEL \
-u ANTHROPIC_DEFAULT_SONNET_MODEL \
-u ANTHROPIC_DEFAULT_HAIKU_MODEL \
-u ANTHROPIC_DEFAULT_FABLE_MODEL \
-u CLAUDE_CODE_SUBAGENT_MODEL \
-u CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY \
-u CLAUDE_CODE_ATTRIBUTION_HEADER \
-u CLAUDE_CODE_AUTO_COMPACT_WINDOW \
-u CLAUDE_CODE_MAX_CONTEXT_TOKENS \
-u CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC \
-u API_TIMEOUT_MS \
"$real" "$@"
}
# <<< claude-mode <<<