v1.2.1
English | Русский
A convenient batch script (.cmd) for installing, updating, and running the official Claude Code CLI client in an isolated environment on Windows.
This script automates the download of the claude.exe executable, isolates configuration files from the main system, and provides a simple interface for configuring API connectivity.
-
Portable / Isolated Mode (Default):
- The script can operate either in portable mode (overriding the
USERPROFILEenvironment variable to point to theclaudefolder inside the script's directory) or in normal (non-portable) mode, using the standard global Windows user profile%USERPROFILE%. This allows reusing an already installed version of Claude Code and its settings. - In portable mode, all global caches, settings, authentication sessions, and Claude Code plugins are stored locally in the script's directory, keeping the global Windows user profile clean.
- The script can operate either in portable mode (overriding the
-
Automatic Installation:
- On the first run, the script automatically checks for the latest version of Claude Code on Anthropic's servers, downloads it using
curl, and sets it up in the appropriate directories.
- On the first run, the script automatically checks for the latest version of Claude Code on Anthropic's servers, downloads it using
-
Flexible Configuration via
settings.ini:- On the first run, the script will prompt you to enter the following parameters:
ANTHROPIC_BASE_URL(defaults to the official API:https://api.anthropic.com, but you can specify your own proxy server).ANTHROPIC_AUTH_TOKEN(authorization token, useful when using proxies or custom gateways).MODEL_NAME(default model, e.g.,claude-sonnet-5).CLAUDE_DIR(path to the Claude Code working directory; defaults to%SCRIPT_DIR%.claudefor portable mode, or%USERPROFILE%for system mode).UPDATE_BRANCH(update branch:mainordev).
- The configuration is saved to a local
resources\settings.inifile and automatically loaded on subsequent runs.
- On the first run, the script will prompt you to enter the following parameters:
-
Profile System:
- The
settings.inifile supports named sections (profiles), allowing you to store multiple configurations in a single file. - A profile can be specified via the
--profile/-pflag with a section name, or selected interactively from a list by running--profilewithout an argument. - Example
settings.iniwith a profile:ANTHROPIC_BASE_URL=http://localhost:20128/v1 ANTHROPIC_AUTH_TOKEN=sk-88cc84a27b153ff0-46fd23-2dcde1b5 MODEL_NAME=openrouter/anthropic/claude-sonnet-5 CLAUDE_DIR=%SCRIPT_DIR%.claude UPDATE_BRANCH=dev UPDATE_REPOSITORY=https://github.com/retopology/Claude-Code-Client UPDATE_MASK=raw/refs/heads/{BRANCH}/claude.cmd [Claude Opus 4.8] MODEL_NAME=openrouter/anthropic/claude-opus-4.8 [Ollama Qwen3.5:9b] ANTHROPIC_BASE_URL=http://localhost:11434 MODEL_NAME=qwen3.5:9b
- The
-
Script Update:
- Built-in update mechanism via the
--update-script/-uflag. - The script downloads the latest version from the specified repository and branch, compares versions, and offers to install the update if one is available.
- Before updating, the current version is saved in
resources\old versions\.
- Built-in update mechanism via the
-
System PATH Integration:
- On first installation, the script checks whether its folder has been added to the user's system
Pathenvironment variable. - If not, it offers to add it automatically, first creating a registry backup in
resources\env_backup.regfor safety. - You can also manually trigger this procedure using the
--add-to-pathflag.
- On first installation, the script checks whether its folder has been added to the user's system
-
Command-Line Argument Passthrough:
- All arguments except those intercepted by the script (
--profile/-p,--update-script/-u,--add-to-path, and--version-script) are passed directly to the underlying executable (e.g.,claude /fastorclaude --help).
- All arguments except those intercepted by the script (
After the first run, the script will create the following directory structure (when using the default portable mode):
📁 /
├── 📄 claude.cmd # Startup script
├── 📁 .claude/ # Local USERPROFILE (isolated environment, created only in portable mode)
│ ├── 📁 .claude/ # Configurations, cache, session history, and plugins
│ └── 📁 .local/
│ ├── 📁 bin/ # Active claude.exe binary
│ └── 📁 share/claude/versions/ # Archive of downloaded versions
└── 📁 resources/
├── 📁 old versions/ # Previous script versions (saved during updates)
├── 📄 settings.ini # Connection settings (URL, token, model, profiles)
├── 📄 claude.exe # Copied executable file
└── 📄 env_backup.reg # Registry backup (created before modifying PATH)
- Operating System: Windows 10 / 11
- Pre-installed
curlutility (built into all modern versions of Windows 10/11) - Internet connection for downloading the executable and interacting with the API
- Double-click
claude.cmdor run it from the console:claude
- The script will check if Claude Code is installed. If it is already installed on your system, you will be prompted to use the installed version or configure portable mode. Otherwise, it will offer to configure portable mode (default).
- The script will prompt you to enter configuration parameters. You can also use the default settings simply by pressing Enter at each prompt.
- Wait for the
claude.exedownload to complete (unless the already installed system version was selected). - When prompted to add the directory to the system
PATH, entery(yes) orn(no). Choosingywill allow you to invoke the client from any folder in the console using theclaudecommand.
After setup, you can simply run the script to start an interactive Claude Code session:
claudeYou can also pass any standard Claude Code arguments:
claude --version
claude /fastRun with a specific profile:
claude --profile work
claude -p workInteractive profile selection:
claude --profile
claude -pYou can manually add the directory containing the script to the user's system PATH at any time:
claude --add-to-pathTo quickly output the version of the client script itself (without launching Claude Code):
claude --version-scriptclaude --update-script
claude -u
claude -u dev