GrepBoard/Manuals
605 manuals ·

Claude Code "Sign in again to take your previous account or API key off the config file"

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

Claude Code warns your previous account or API key may still be in ~/.claude.json after a login or logout. Re-run claude auth login or logout to retry the save.

text
Sign in again to take your previous account or API key off the config file.

If this warning appears after you sign in, an account you used before may still be stored in ~/.claude.json. Run claude auth login in your shell once more and Claude Code retries the save that removes the replaced account or API key from the file.

A sibling warning exists for logging out, and the command to re-run differs, so match the wording first.

WarningAppearsRe-run
Sign in again to take your previous account or API key off the config file.After you sign inclaude auth login
Your account or API key may still be in the config file. Run claude auth logout.After /logout or claude auth logoutclaude auth logout

[1] Pick the row that matches when the warning appeared. Both messages point at ~/.claude.json, which holds account details, per-project trust decisions, personal MCP servers, and UI toggles. If you set CLAUDE_CONFIG_DIR, the file lives under that directory instead.

[2] For the warning after a login, run the login command again from a regular shell, not inside a Claude Code session.

console
$ claude auth login

The docs say only that Claude Code then retries the save that takes the replaced account or API key off the file. They don't list a success message for this command, so judge the result by whether the warning comes back.

[3] For the warning after a logout, re-run the logout the same way.

console
$ claude auth logout

When the save goes through, the docs say the command prints this line:

output
Successfully logged out from your Anthropic account.

By the docs' description, Claude Code has already signed this process out but couldn't confirm that the file no longer holds your account. Either the save didn't land, or the file couldn't be read back to check.

[4] Both warnings carry one more sentence. If a Console login created an API key on Linux or Windows, that key may still be in ~/.claude.json too. The fix is still the single command from [2] or [3].

[5] If the same warning returns after re-running the command, the two warning sections have no further step. The docs don't state the cause of this warning, so none is asserted here. The same errors page does have a section saying that a full disk or quota on the config directory's disk keeps a new login from being saved, and that signing in again won't help then. That isn't documented as the cause of this warning; treat free disk space (df -h ~) as a place worth a look. A request that fails with a 401 after login is covered in OAuth token has expired (401).

Tell it apart from other login messages

MessageMeaningPost
Sign in again to take your previous account or API key off the config file.Previous account or key may remain in the file after a loginthis post
Your account or API key may still be in the config file. Run claude auth logout.The file couldn't be checked after a logoutthis post
Couldn't save your loginThe login wasn't written to the credential storeCouldn't save your login
Could not resolve authentication methodThe session has no credential at allCould not resolve authentication method
Your apiKeyHelper script is failingThe key script returned no usable keyapiKeyHelper script is failing
Any other error textClaude Code errors by message

#claude-code#login#logout#claude-json#authentication