---
title: "Claude Code or Codex login opens the wrong browser profile · Profile Porter"
description: "Why claude /login and codex login open the sign-in page in the wrong browser or profile, and how to fix it: copy the login link, use Codex&#x27;s device code, keep one config folder per account, or send sign-in links to the right profile."
url: "https://profileporter.com/how-to/claude-code-codex-login-wrong-browser-profile/"
---

How to

# Claude Code or Codex login opens the wrong browser profile? Here's the fix

Updated 19 November 2026

You run `claude` or `codex login`, and the sign-in page opens in your personal browser profile, signed in to the wrong account. Both tools open your default browser, and the browser picks the profile. Here's how to sign in to the right account every time.

On this page

1. [Why the sign-in opens in the wrong profile](https://profileporter.com/how-to/claude-code-codex-login-wrong-browser-profile/#why)
2. [Claude Code: copy the login link](https://profileporter.com/how-to/claude-code-codex-login-wrong-browser-profile/#claude-code)
3. [Codex: sign in with a device code](https://profileporter.com/how-to/claude-code-codex-login-wrong-browser-profile/#codex)
4. [Two Claude accounts on one computer](https://profileporter.com/how-to/claude-code-codex-login-wrong-browser-profile/#accounts)
5. [Every tool: sign-in links where you're signed in](https://profileporter.com/how-to/claude-code-codex-login-wrong-browser-profile/#every-tool)

## Why the sign-in opens in the wrong profile

Claude Code and the Codex CLI sign in through a browser window. Your default browser gets the sign-in link, and it opens the link in the profile whose window you used last.

If that profile is signed in to your personal Claude or ChatGPT account, you approve the tool with the wrong account. With a work plan and a personal plan, the terminal then bills or limits the wrong one.

## Claude Code: copy the login link

Claude Code opens the sign-in page when you first run `claude`, and when you type `/login`. To open it in another profile:

1. Close the tab that opened in the wrong profile.
2. In the terminal, press **c** to copy the login link.
3. Paste it into a window of the right profile, and sign in.
4. If the page shows a code, paste it at the **Paste code here if prompted** prompt.

The terminal shows **Login successful** when it's done.

## Codex: sign in with a device code

The device code sign-in doesn't open a browser at all. You open the link yourself, in any profile:

```
codex login --device-auth
```

Open the link it prints in the right profile, sign in, and enter the one-time code. OpenAI calls this beta. Turn it on first in your ChatGPT security settings, or, for a workspace, your admin turns it on in the workspace permissions.

## Two Claude accounts on one computer

If you use a work and a personal Claude account, give each its own configuration folder with `CLAUDE_CONFIG_DIR`. Each folder keeps its own sign-in:

```
CLAUDE_CONFIG_DIR=~/.claude-work claude
```

Sign in once in each, from the right browser profile. Put the line in a shell alias, such as `claude-work`, to keep it.

## Every tool: sign-in links where you're signed in

Copying links works, but you do it every time a token runs out. [Profile Porter](https://profileporter.com/) does it for you on Mac and Windows. Make it your default browser. When a tool's link starts a sign-in, such as the login page of Claude Code or Codex, it opens in the profile that is signed in to that provider.

- If no profile is signed in, it asks rather than guess, and remembers your pick for sign-ins from that app.
- If you were on the site in the last 15 minutes, the link goes to that profile.
- No setup per tool: it looks at the link itself, so `gh`, `aws`, `gcloud` and other tools that open a sign-in page work the same way.

Get Profile Porter for €12, once.

Everything included, no account, and a full refund within 14 days if it isn't for you. macOS 14 or later; on Windows 10 and 11, [get it from the Microsoft Store](https://apps.microsoft.com/detail/9N5C3B974DL2).

[Download](https://profileporter.com/download/)

## Related

- [gh auth login and aws sso login open the wrong browser profile](https://profileporter.com/how-to/terminal-sign-in-links-wrong-profile/)
- [VS Code: open links in a specific browser or Chrome profile](https://profileporter.com/how-to/vscode-open-links-in-browser-profile/)
- [How to open links in a specific Chrome profile](https://profileporter.com/how-to/open-links-in-chrome-profile/)
