The Session Lifecycle
Claude Code maintains a stateful session from the moment you run claude. This session tracks:
- Conversation history
- Files you've read
- Tools that have been executed
Unlike standard chat interfaces, the CLI is designed for long-running interactions.
Session Persistence
Claude Code can resume sessions. When you exit and come back, you may be able to continue where you left off (depending on configuration).
When to Clear
As sessions grow, context can become cluttered. Use /clear when:
- Switching to a completely different task
- Claude seems confused by old context
- You want to reduce token usage