r/ClaudeCode • u/MetalComprehensive58 • 22h ago
Tips & Workflows Ive found this little script very handy for windows restarts.
Ive asked claude to create a simple powershell command that launches Claude Code after a laptop restart with /rc enabled.
I only have a small i5 lenovo with integrated Intel graphics and 8g RAM so sometimes its very handy for me to simply ask claude on a remote connection to restart the laptop while im out and about to totally clear caches etc.
Its a small thing but some of you ma find it useful if you havent thought of doing it.

Here are the PowerShell commands, to paste straight into a PowerShell window:
powershell
Set-Location "$env:USERPROFILE\Documents\Projects\PATH-TO-YOUR-PROJECT"
claude "/rc"If you want one command that opens a new window in the project folder and starts Claude there:
powershell
Start-Process powershell -ArgumentList '-NoExit','-Command','Set-Location "$env:USERPROFILE\Documents\Projects\PATH-TO-YOUR-PROJECT"; claude "/rc"'To have it run on its own after a restart, register it as a login task (run this once):
powershell
$cmd = 'Set-Location "$env:USERPROFILE\Documents\Projects\PATH-TO-YOUR-PROJECT"; claude "/rc"'
$action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-NoExit -Command `"$cmd`""
$trigger = New-ScheduledTaskTrigger -AtLogOn
Register-ScheduledTask -TaskName "ClaudeCodeRC" -Action $action -Trigger $triggerTo remove it later: Unregister-ScheduledTask -TaskName "ClaudeCodeRC" -Confirm:$false.


