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.

View original on GitHub ↗

16 Comments

Bikz · 1 year ago

I haven't ran claude code in docker yet, but I usually /exit and claude again for a quick restart

markz889 · 1 year ago

+1 for the OP, I have exactly the same situation and I also looked for a "/restart" cmd

jwr · 1 year ago

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.

8enmann collaborator · 1 year ago

Can you ctrl+c and restart? or is claude code literally your entrypoint in the docker container?

jwr · 1 year ago

Yes, of course it is, this is how I run claude code interactively in a docker container:

d run -it -e CLAUDE_CONFIG_DIR=/home/node/.claude --volume ~/.config/claude-code:/home/node/.claude --volume .:/workspace jrychter/claude-code claude

This persists the settings/configuration.

jmarkmorris · 1 year ago

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.

igagen · 1 year ago
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.

markz889 · 1 year ago

In addition to suggestions above, some further workarounds when using claude-code in a container (eg the supplied devcontainer or your custom variant):

  1. Rebuild the whole container, uncached, every time:

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.

  1. Uncache the installation of the claude-code npm package:

Add a var in the dockerfile just prior to the npm install, eg:
ARG NOCACHE
# Install Claude
RUN npm install -g @anthropic-ai/claude-code

Then 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?).

lifeinchords · 1 year ago

I got it to work by doing:
npm update -g @anthropic-ai/claude-code

I apparently had a pretty old version. I tried"

  • /exit, then claude
  • closing iTerm, re-opening, claude
  • rebooting

after the npm update I see new commands, like /migrate-installer, and no more update message

briandonahue · 1 year ago

If you used the /migrate-installer and are now running claude locally instead of from npm packages, I got the message to go away by doing claude update in terminal before running claude again

legel · 1 year ago

_after_ /migrate-installer in Claude Code to switch from NPM to local installation...

claude update in terminal works great, thanks @briandonahue

mulka · 1 year ago

Tried 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

RichardLiu6 · 1 year ago

@briandonahue thanks so much, claude update works well for the local one

github-actions[bot] · 9 months ago

This 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.

catherinewu contributor · 7 months ago

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!

github-actions[bot] · 7 months ago

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.