# claude-forget launcher for Windows: makes Claude Code forget folders on this computer. # # irm https://ccc.hajimi.download | iex # # It downloads claude-forget into a temporary folder, checks its SHA-256, runs it, # then deletes the temporary folder and removes this command from PowerShell's # history. If no Python 3.10+ is installed, a standalone Python is fetched into # the same temporary folder and deleted with it. Nothing is installed. & { $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $Base = 'https://ccc.hajimi.download' $Version = '0.2.1' $PyzSha256 = '3b0e245be9e64ebbf7b2384472b899dd556f8554debf1f7cabed799c480f2423' $HostName = 'ccc.hajimi.download' $PbsRelease = '20261026' $PbsPython = '3.13.18' function Test-Sha256($Path, $Expected) { $actual = (Get-FileHash -LiteralPath $Path -Algorithm SHA256).Hash if ($actual -ne $Expected.ToUpperInvariant()) { throw "checksum mismatch for $(Split-Path -Leaf $Path); not running it" } } function Find-Python { foreach ($candidate in @(@('py', '-3'), @('python'), @('python3'))) { $command = Get-Command $candidate[0] -CommandType Application -ErrorAction SilentlyContinue | Select-Object -First 1 if (-not $command) { continue } $extra = @($candidate | Select-Object -Skip 1) # The Microsoft Store stub exits non-zero here instead of running Python. & $command.Source @extra -c 'import sys; sys.exit(sys.version_info < (3, 10))' 2>$null | Out-Null if ($LASTEXITCODE -eq 0) { return , (@($command.Source) + $extra) } } return $null } function Get-StandalonePython($Directory) { switch ($env:PROCESSOR_ARCHITECTURE) { 'AMD64' { $triple = 'x86_64-pc-windows-msvc' $sum = '7369f7a35f261222a6ac8b3a87c1c88eeebee8af945d85346202591a64038dd3' } 'ARM64' { $triple = 'aarch64-pc-windows-msvc' $sum = 'bd3315abb8abb8ce5b19c2c2b709d318f983e0b8753d0830831df07c46474699' } default { throw "no Python 3.10+ found; install Python from python.org and retry" } } Write-Host "No Python 3.10+ found; fetching a temporary Python $PbsPython (deleted afterwards)..." $archive = Join-Path $Directory 'python.tar.gz' $name = "cpython-$PbsPython%2B$PbsRelease-$triple-install_only_stripped.tar.gz" Invoke-WebRequest -UseBasicParsing -OutFile $archive ` "https://github.com/astral-sh/python-build-standalone/releases/download/$PbsRelease/$name" Test-Sha256 $archive $sum tar.exe -xzf $archive -C $Directory if ($LASTEXITCODE -ne 0) { throw 'could not unpack the temporary Python' } Remove-Item -LiteralPath $archive -Force return , @(Join-Path $Directory 'python\python.exe') } $tmp = Join-Path ([IO.Path]::GetTempPath()) ('claude-forget-' + [guid]::NewGuid().ToString('N')) New-Item -ItemType Directory -Path $tmp | Out-Null try { $pyz = Join-Path $tmp 'claude-forget.pyz' Invoke-WebRequest -UseBasicParsing -OutFile $pyz "$Base/claude-forget-$Version.pyz" Test-Sha256 $pyz $PyzSha256 $python = Find-Python if (-not $python) { $python = Get-StandalonePython $tmp } $exe = $python[0] $extra = @($python | Select-Object -Skip 1) & $exe @extra -I -B $pyz --scrub-shell-history $HostName } catch { Write-Host "claude-forget: $($_.Exception.Message)" -ForegroundColor Red } finally { Remove-Item -LiteralPath $tmp -Recurse -Force -ErrorAction SilentlyContinue Clear-History -CommandLine "*$HostName*" -ErrorAction SilentlyContinue } }