Claude CLI Login 101 · Lesson 4
Real proof and prevention
Validate state, protected storage, and a real request.
By the end
- Validate state, protected storage, and a real request.
- Apply the safe command for this step.
1
The big idea
Working means three signals together: loggedIn true, mode 600, and a real model request that responds.
Think of it like… It is trying the key in the real door, not just checking whether it looks new.
A real request crosses authentication, persistence, and service access, so it is the strongest final proof.
2
In one picture
3
Try it
claude -p 'Reply exactly: CLAUDE_LOGIN_OK' --output-format text
CLAUDE_LOGIN_OKRemember: A screen is a clue; the command is proof.
Quick check
What is the strongest final proof?
Use evidence that crosses the real boundary without exposing a secret.
10
Ten rules
The Part of Tens
- Status beats screens
- Never print tokens
- Use official logout
- Do not delete ~/.claude
- CAPTCHA is manual
- Check mode 600
- Make a real request
- Separate auth from network
- Compare before/after
- Stop when it converges