OmniscioGuidesCouldn't save your login
Claude Code: Couldn't save your login — the keychain fix
Last checked against Anthropic's documentation on November 17, 2026. By the Omniscio team. Updated .
What is the exact message?
Couldn't save your login. If your Mac's keychain is locked, unlock it and log in again.Every other platform prints the shorter form:
Couldn't save your login. Try logging in again.Anthropic's error reference carries both, and says the first appears on macOS and the second everywhere else.
What does it mean?
You signed in, and the browser side may have finished. What failed is the last step: writing the credential where the next session reads it.
On macOS that place is the encrypted login Keychain. Anthropic documents two outcomes when the Keychain refuses the write. Which one you get depends on the kind of login you used, not on the wording you see.
- A claude.ai login can still be saved. Claude Code stores it in a plaintext file at
~/.claude/.credentials.jsoninstead, and you are signed in, with the Keychain still to fix. - A Console login that creates an API key cannot complete. That login has nowhere else to go, so it stops here until the Keychain is writable again.
Run /status to see which credential the session is using right now. If it lists a login, this session is signed in; the Keychain still needs repairing so your next sign-in can save.
Why the Keychain refuses the write
- It locked on sleep or idle. The documented case, and the one the message's own wording points at.
- You are in an SSH session. Anthropic names a locked Keychain in an SSH session as an example.
- Its password is out of sync with your account. Anthropic's install troubleshooting names a Keychain password that no longer matches your account password.
- The credential store timed out or could not be read. Anthropic says a transient credential-store failure produces the same message, so it is worth one more attempt before you go any further.
On Linux and Windows the message is the short form. The credential is a file, and Anthropic documents no Keychain step there: the fix is to sign in again once the file can be written.
How do I fix it?
These are Anthropic's own steps, in its order. They are for macOS, where the message names the Keychain.
- Ask
claude doctor. When the Keychain rejects writes, the report carries a warning that starts withmacOS Keychain is not writableand a suggested fix. No warning means it is writable, so skip to the last step. - Unlock it. Run
security unlock-keychain ~/Library/Keychains/login.keychain-db, enter your Keychain password, and runclaude doctoragain. The warning should be gone. - Resync the password. If unlocking does not help, open Keychain Access, select the
loginkeychain, and choose Edit > Change Password for Keychain "login". Runclaude doctoronce more. - Log out, then log in. With the Keychain writable, run
/logoutand then/login. Claude Code moves the login back into the Keychain when it next writes a credential, and this forces it now.
Wait before you log out. Logging out removes every stored credential, including the plaintext file's contents, saved MCP server logins and plugin secrets, so expect to re-authorize MCP servers and re-enter plugin secrets afterwards.
How do I know it is fixed?
claude doctorreports no Keychain warning./logincompletes and the terminal showsLogin successful./statusnames the account you expect, and the message does not return on your next request.
Where these answers come from
- Anthropic's error reference, read November 17, 2026: both wordings, the macOS/other split, the credential store, and the locked-Keychain cause.
- Install and login troubleshooting, read November 17, 2026: the fallback file, the Console API-key failure, and the four recovery steps.
- Authentication, read November 17, 2026: where each platform stores credentials, and
CLAUDE_CONFIG_DIR. - Our guide to Claude Code login errors, for every other sign-in message.
Common questions
Do I have to log out?
Only for the last step, and only once claude doctor reports the Keychain as writable. Logging out before that just costs you the saved MCP logins and plugin secrets without moving anything into the Keychain.
I am on Windows or Linux. What do I do?
Run /login again. Your credential is a file at ~/.claude/.credentials.json on Linux, or %USERPROFILE%\.claude\.credentials.json on Windows, and Anthropic documents no Keychain step outside macOS.
Does this sign me out of my other sessions?
Not on its own. Parallel sessions on one machine share a saved login and coordinate its renewal, so the other sessions keep working once the login is saved.
How is this different from "Login expired"?
This message is about the write: Claude Code could not store the login it just obtained. Login expired is about an existing login that could no longer be renewed; it and every other sign-in message are on the Claude Code login errors page.
I am in the Claude desktop app, not a terminal.
Then this is not your message. A session the desktop app runs shows Authentication required · Sign in again to continue, and you sign in again from the app.