[BUG] incorrectly showing the login message
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: claude code current
- Operating System: macOS current
- Terminal: VSCode terminal
Bug Description
Title: Terminal history and context wiped after forced re-login that wasn't needed
Description:
Was in the middle of a productive coding session with Claude Code when I got an error saying I wasn't logged in (even though I was). When I tried to continue, it forced me to
restart the session, which:
- Wiped the entire terminal history and conversation context
- Lost all the todos that were being tracked
- Lost all the context about what we were working on
- The login "error" was bogus - I was already logged in
This is a critical UX issue because:
- Hours of conversation context just disappear
- No way to recover the todo list or previous discussion
- No warning that restarting will delete everything
- The login error itself was incorrect
Expected behavior:
- If a re-login is needed, preserve the terminal history and context
- Provide a way to export/save context before forcing a restart
- Don't throw login errors when the user is actually logged in
- At minimum, warn users that continuing will lose all their work context
Impact: Lost significant work context and todo tracking mid-session
Steps to Reproduce
- Login
- Work for a while
- Come back the next morning
- Have a 'you aren't logged in message' from a single missed API call (not sure how, maybe one expired token)
- Try to login
- Notice that the whole entire terminal history is wiped for a full screen login graphic
- Can't get your context back because the login screen blew it away
Expected Behavior
Let me retry and it would have noticed i was logged in. OR, don't make the login function so sucky to wipe the whole terminal history. OR, allow not logged in users to do a context save of some sort. I'm sure i could come up with some more ideas if you need, there's lots of ways to avoid this.
Actual Behavior
got wrecked, lost my place in the middle of a sprint that i didn't document, so I have to recreate everything
Additional Context
hire me to fix claude code ig
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗