GrepBoard/Manuals
605 manuals ·

Fix Claude Code "Couldn't save your login"

·Tested on Claude Code official docs · 2026-11·Test scope ↓·6 steps

Claude Code "Couldn't save your login" means sign-in worked but the credential store rejected the write. On macOS, unlock the login keychain, then run /login.

text
Couldn't save your login. If your Mac's keychain is locked, unlock it and log in again.Couldn't save your login. Try logging in again.

You signed in with your claude.ai account, but Claude Code could not write the login to its credential store, so the login did not complete. On macOS, unlock the login keychain and run /login again. On any other platform, run /login again.

The two lines are the same error. The first one, with the keychain hint, appears on macOS. The second appears everywhere else. The official docs say a transient credential-store failure, such as a timeout or an unreadable store, produces the same message, so one occurrence does not mean your keychain is broken.

[1] Run /login once more. If the failure was transient, that is all it takes. The typical macOS case in the docs: Claude Code already read or saved credentials in the keychain during the session, then the login keychain locked on sleep or idle. If the error showed up after you stepped away, this is likely it.

[2] On macOS, run claude doctor first to check whether the keychain is writable.

console
$ claude doctor

When the keychain rejects writes, the report lists a warning that starts with macOS Keychain is not writable, followed by a suggested fix. With no such warning the keychain is writable, so skip [3] and [4] and go to [5].

[3] If there is a warning, unlock the login keychain in the same shell you run Claude Code from. Enter your keychain password when prompted.

console
$ security unlock-keychain ~/Library/Keychains/login.keychain-db

This is the command from the official troubleshooting page. Then run claude doctor again and confirm the warning is gone.

[4] If unlocking doesn't clear the warning, resync the keychain password. Open Keychain Access, select the login keychain, and choose Edit > Change Password for Keychain "login" so it matches your account password. Run claude doctor again and confirm the warning is gone.

[5] If the keychain is writable again but the login still sits in the plaintext file, run /logout and then /login. According to the docs, Claude Code moves the credentials back into the keychain the next time it writes a credential; these two commands force it now.

[6] On a platform other than macOS, run /login again. For this case the docs list no keychain procedure and only point to the same troubleshooting page for credential-storage recovery.

Telling it apart from similar messages

MessageMeaningPost
Couldn't save your loginSign-in finished, but the store rejected the writeThis post
Not logged in · Please run /loginNo usable credential in this sessionClaude Code error messages and fixes
API Error: 401 OAuth token has expiredStored token expired and refresh failed401 OAuth token has expired
Couldn't read the stored credentials for MCP server "<name>"MCP server login could not be read from the storeNote below

The MCP server message is the read-side counterpart of the same keychain problem. For its macOS form, the docs also say to check claude doctor for a keychain warning and run the security unlock-keychain command above only when a warning is listed. Your stored MCP logins are unchanged, so retry once the keychain is readable.

#claude-code#login#keychain#macos#authentication