[BUG] OAuth port 54545 conflicts with macOS mobileactivationd and unable to change ports

Status Fixed / completed
Maintainer reply ✓ Yes — ant-kurt
Activity 13 comments · opened Jun 25, 2025 · closed Aug 25, 2025
💡 Likely answer: A maintainer (ant-kurt, collaborator) responded on this thread — see the highlighted reply below.

Environment

  • Platform (select one):
  • [X] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.34 (Claude Code)
  • Operating System: macOS 15.3.1
  • Terminal: MacOS default Terminal

Bug Description

When I run Claude from the terminal, it takes me through the setup and when I once I've selected a login method, it tells me that the port 54545 is already in use.

The process that's using that port is a Mac process so I'm unable to change the port that uses and there is no port configuration that I can find for claude.

So I'm unable to use claude at all.

Steps to Reproduce

Step 1 - Dark Mode
Step 2 - Select Login Method - I select "Claude account with subscription"

Expected Behavior

Explained above

Actual Behavior

Prevented from using claude due to a port conflict.

Additional Context

I ran "lsof -i :54545" and it reports that "mobileactivationd" is occupying the port.

View original on GitHub ↗

13 Comments

ant-solo · 1 year ago

Is there a way to configure the port that claude code uses for this?

xalil8 · 1 year ago

any solution ?

xalil8 · 1 year ago

reboot the machine solved my problem

ant-solo · 1 year ago

I create a docker image and started Claude up in that image to workaround this issue but it is just a workaround. I mapped local folders in to the container so that I could share results.

It would be far easier to be able to configure the port to allow us to solve the issue when we encounter it.

zackerydev · 1 year ago

FWIW - I was able to workaround this issue by opening Activity Monitor and Force Quitting mobileactivationd

Margar1ta · 1 year ago

Update to sequoia 15.5 fix this for me

humzam · 1 year ago

I'm running into the same error and the above solutions haven't worked for me.

  • I force quitted mobileactivationd
  • I'm already on Seqouia 15.5

Strangely, running lsof -i :54545 yields no results 🤔

gitgonow · 1 year ago

Same problem, and killing mobileactivationd did not fix it.

michaelbontyes · 1 year ago

Closing Claude desktop client + Claude code in my CLI solved it. Then I was able to complete the activation and login through the Claude Code extension in Cursor.

<img width="627" height="120" alt="Image" src="https://github.com/user-attachments/assets/ffe62ac2-22ad-4658-ad60-f0ce11a3a2d5" />

humzam · 1 year ago

Well, I took no further steps and just tried it again today after a week, and its suddenly working! 🤷‍♂️

petsoukos · 1 year ago

For me it was a 2nd VSCode app open connected via remote ssh tunnel and was port forward that port from trying to connect that instance's Claude Code. I did not proceed with that instance and it just remained forwarded in VSCode's PORTS tab.

ant-kurt collaborator · 1 year ago

This should be working better in the upcoming release!

github-actions[bot] · 12 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.