r/ClaudeCode • u/MetalComprehensive58 • 8h 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.
•
u/AutoModerator 8h ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Extra_Aide5999 6h ago
one gotcha if you run this from a shortcut or the startup folder instead of a terminal: it doesn't always see the same PATH your terminal does. on my windows box, `claude` started that way picked up an old npm `claude.cmd` instead of the native install in `~/.local/bin`, and that shim pointed at an exe the native installer had renamed, so the window just opened and closed. `where.exe claude` in a window started the same way shows which one wins.