claude-code·Published 2026.06.01
Claude Code /logout: Safely Remove Your Account on a Shared PC
When finishing work in a shared environment or switching accounts, /logout safely logs you out of your Anthropic account. A beginner-friendly guide.
On your own PC, staying logged in is fine. But it's a different story if you worked on a shared computer or company shared equipment. If your account stays signed in, the next person could use it as-is. The command that cleanly removes your account in such cases is /logout.
Definition (What It Is)
/logout is a command that logs you out of the currently signed-in Anthropic account.
Logout is the opposite of login, meaning "sever my account's connection on this device." Logging out releases the stored authentication info, so to use it again you must log in anew with /login. It's the command for ensuring your account isn't left behind in a shared environment, or for switching to another account.
How to Use It (By Difficulty)
Basic — Logging Out
Type it.
/logout
This logs you out of the current account. The stored authentication info is released, so to work afterward you'll need to log in again.
Intermediate — Making It a Wrap-Up Habit
In a shared environment, it's good to set logout as the final step when finishing work.
- Finish your work.
- Handle anything to save or upload first.
- Lastly, remove the account with
/logout.
Setting an order keeps you from forgetting. Especially on devices others also use — academies, shared offices, company shared equipment — this habit protects your account.
Advanced — Using It for Account Switching
Logout is also the starting point when switching the account you use.
- Leave the current account with
/logout. - Enter the other account with
/login.
If you split a personal account and a work account, you can switch cleanly with this flow.
Common Pitfalls
- After logging out, you'll have to go through the login procedure again to use it. On your own personal PC, there's no need to log out every time. Judge by the environment.
- Before logging out, first check whether there's work to save or upload. If authentication drops, some actions get blocked, so unfinished work can become a hassle.
Real-World Example
A beginner developer worked briefly on a shared-office computer and just left their seat. Only later did they realize their account had stayed signed in, and broke into a cold sweat. After that, they made it a rule to always type /logout last when working on shared equipment. Account security comes down to one small habit.
Taking It Further
Logout is a pair with login. When working again or entering another account, just authenticate with /login. In a shared environment, remembering "/login when entering, /logout when leaving" as one set keeps your account safe wherever you work.
Summary
/logout is a command that logs you out of the current Anthropic account, releasing the stored authentication info. Be sure to do it when finishing work in a shared environment or switching accounts. You don't need to do it every time on your own PC, but on devices others also use, make it a habit as the final step.
Based on: Claude Code v2.1.154 (2026.05)
Comments
Comments 0
Checking sign-in status…
Loading comments…