Feature: add a /restart option
Resolved 💬 16 comments Opened Mar 11, 2025 by jwr Closed Nov 30, 2025
💡 Likely answer: A maintainer (8enmann, collaborator)
responded on this thread — see the highlighted reply below.
The current update mechanism doesn't work well when running Claude Code in a docker container. The software says "Update installed · Restart to apply", but restarting the entire container rolls back the update, and there seems to be no good way to restart the app within the container.
A /restart option would help as an interim solution.
As a side note, rebuilding the docker container doesn't update the software, because the "RUN npm install -g @anthropic-ai/claude-code" line is cached.
16 Comments
I haven't ran claude code in docker yet, but I usually /exit and claude again for a quick restart
+1 for the OP, I have exactly the same situation and I also looked for a "/restart" cmd
FWIW, I ended up modifyng the Dockerfile to include the exact version number of the npm package. That lets me rebuild the container and use the updated version.
Can you ctrl+c and restart? or is claude code literally your entrypoint in the docker container?
Yes, of course it is, this is how I run claude code interactively in a docker container:
This persists the settings/configuration.
I see the "Update installed · Restart to apply" message continuously in claude running in a terminal in vscode. There is no /restart command. I tried /exit and then started claude again, and the "Update installed · Restart to apply" message is there again. I checked /doctor and it says everything is healthy. I spent 30 minutes trying to figure out how to do this and no joy.
I'm experiencing the same. Not sure how to apply the update aside from reinstalling everything.
In addition to suggestions above, some further workarounds when using claude-code in a container (eg the supplied devcontainer or your custom variant):
docker build --pull --no-cache -t claude-code .This will get you the latest of everything, but is a bit tedious to run several times per day.
Add a var in the dockerfile just prior to the npm install, eg:
ARG NOCACHE# Install ClaudeRUN npm install -g @anthropic-ai/claude-codeThen build the image using:
docker build --build-arg NOCACHE=$(date +%s%N) -t claude-code .The image will be cached up to the point of the env var, and will be rebuilt from then onwards (eg the npm install will not be cached).
If you wrap this up in "claude-run.sh" bash, you can get the latest version of the npm package every time you run the claude-code container, with minimal build-delay.
Note, for a "/restart" option to work within a container, I expect it will have to not completely quit the npm package, as this will end the user container in most cases, so "/restart" is going to need be smarter than that (or maybe wrapped in bash which can handle "/quit" vs "/restart", via exit code?).
I got it to work by doing:
npm update -g @anthropic-ai/claude-codeI apparently had a pretty old version. I tried"
/exit, thenclaudeclaudeafter the
npm updateI see new commands, like/migrate-installer, and no more update messageIf you used the
/migrate-installerand are now running claude locally instead of fromnpmpackages, I got the message to go away by doingclaude updatein terminal before runningclaudeagain_after_
/migrate-installerin Claude Code to switch from NPM to local installation...claude updatein terminal works great, thanks @briandonahueTried really hard to get claude code to restart itself. It seemed to think it could, but had to Ctrl+C.
https://github.com/user-attachments/assets/66663875-f7c0-4189-835c-9c65cc9ab680
@briandonahue thanks so much,
claude updateworks well for the local oneThis issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Hi - we've made many reliability improvements to the auto-upgrader so this should be less of an issue now. We've also switched users over to our native installer. Please open a new issue if you are still experiencing issues. Thank you!
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.