Session Management in AI
From the Claude Code cheat sheet ยท Essential Commands ยท verified Jul 2026
Session Management
Control your Claude Code session
bash
# Authentication
/login # Log in to your account
/logout # Sign out completely
# Session control
/exit # Exit Claude Code (also: exit, Ctrl+C)
/clear # Clear conversation history
/help # Show available commands
# Context management
/compact # Reduce context size when near limitbash
// EXAMPLE: Managing a long session
> "Help me build a REST API"
[... extensive work ...]
> /compact // Reduce context when getting full
> "Now add authentication"
// EXAMPLE: Starting fresh
> /clear
> "Let's work on a different feature"๐ Use /clear to start fresh
๐ /compact helps with long sessions
๐ Multiple ways to exit
commandssession