Claude Portable · GitHub
/" data-turbo-transient="true" />
Skip to content
-->
Search Gists
Search Gists
Sign in
Sign up
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
mlajtos/InstallClaudePortable.cmd
Created<br>July 29, 2026 07:12
Show Gist options
Download ZIP
Star
(0)
You must be signed in to star a gist
Fork
(0)
You must be signed in to fork a gist
Embed
Select an option
Embed<br>Embed this gist in your website.
Share<br>Copy sharable link for this gist.
Clone via HTTPS<br>Clone using the web URL.
No results found
Learn more about clone URLs
Clone this repository at <script src="https://gist.github.com/mlajtos/138886341335ad4ddbfb034039e39a28.js"></script>
" readonly="readonly" data-autoselect="true" data-target="primer-text-field.inputElement " aria-describedby="validation-192f982a-59f5-4be6-85f8-ec3b9ff1bc4a" class="form-control FormControl-monospace FormControl-input FormControl-small rounded-left-0 rounded-right-0 border-right-0" type="text" name="gist-share-url-sized-down" />
Save mlajtos/138886341335ad4ddbfb034039e39a28 to your computer and use it in GitHub Desktop.
Embed
Select an option
Embed<br>Embed this gist in your website.
Share<br>Copy sharable link for this gist.
Clone via HTTPS<br>Clone using the web URL.
No results found
Learn more about clone URLs
Clone this repository at <script src="https://gist.github.com/mlajtos/138886341335ad4ddbfb034039e39a28.js"></script>
" readonly="readonly" data-autoselect="true" data-target="primer-text-field.inputElement " aria-describedby="validation-5e9430e8-3f62-4d1f-90d1-4229d2c00926" class="form-control FormControl-monospace FormControl-input FormControl-small rounded-left-0 rounded-right-0 border-right-0" type="text" name="gist-share-url-original" />
Save mlajtos/138886341335ad4ddbfb034039e39a28 to your computer and use it in GitHub Desktop.
Download ZIP
Claude Portable
Raw
InstallClaudePortable.cmd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.<br>Learn more about bidirectional Unicode characters
Show hidden characters
@echo off
REM =====================================================================
REM InstallClaude.cmd - run ONCE, on a machine you trust.
REM Downloads + verifies claude.exe, writes an INERT, self-elevating
REM Claude.cmd plus config.txt, a field-IT CLAUDE.md, and a safe-fast
REM settings.json, then opens Claude Code for a one-time login.
REM Everything below the "#PS-PAYLOAD#" line is PowerShell, run by the
REM line just below. cmd never runs it. It is not obfuscated - read it.
REM =====================================================================
setlocal
set "ROOT=%~dp0"
set "BUCKET=https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases"
md "%ROOT%bin" 2>nul & md "%ROOT%data" 2>nul & md "%ROOT%tmp" 2>nul & md "%ROOT%work" 2>nul
powershell -NoProfile -ExecutionPolicy Bypass -Command "$t=[IO.File]::ReadAllText('%~f0'); iex $t.Substring($t.LastIndexOf([char]10+'#PS-PAYLOAD#'))" || (echo. & echo Install failed - nothing was kept. Run on a trusted machine with internet. & echo. & pause & exit /b 1)
echo.
echo Setup complete. Opening Claude Code so you can log in...
echo After you log in, type /exit , then eject the stick.
echo.
set "CLAUDE_CONFIG_DIR=%ROOT%data"
set "DISABLE_AUTOUPDATER=1"
cd /d "%ROOT%work"
"%ROOT%bin\claude.exe"
exit /b 0
#PS-PAYLOAD#
$ErrorActionPreference = 'Stop'
$root = $env:ROOT
$bucket = $env:BUCKET
$plat = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { 'win32-arm64' } else { 'win32-x64' }
$exe = Join-Path $root 'bin\claude.exe'
if (-not (Test-Path $exe)) {
Write-Host " Downloading Claude Code ($plat)..."
$ver = (Invoke-WebRequest "$bucket/latest" -UseBasicParsing).Content.Trim()
$want = ((Invoke-WebRequest "$bucket/$ver/manifest.json" -UseBasicParsing).Content | ConvertFrom-Json).platforms.$plat.checksum
Invoke-WebRequest "$bucket/$ver/$plat/claude.exe" -OutFile $exe -UseBasicParsing
if ((Get-FileHash $exe -Algorithm SHA256).Hash.ToLower() -ne $want.ToLower()) { Remove-Item $exe; throw "SHA256 mismatch - aborted." }
$sig = Get-AuthenticodeSignature $exe
if ($sig.Status -ne 'Valid' -or $sig.SignerCertificate.Subject -notlike '*Anthropic*') { Remove-Item $exe; throw "Not signed by Anthropic - aborted." }
Write-Host " Verified claude.exe v$ver - $($sig.SignerCertificate.Subject)"
} else {
Write-Host " claude.exe already present - skipping download."
function Write-IfAbsent($path, $text) {
if (Test-Path $path) { Write-Host " kept existing...