Chapter 05 · CLI
Sessions: resume, continue, branch and history management
Claude Code sessions persist and you can return to them: resume a previous session, continue the latest one, and fork/branch at a split point. Managing history well saves work and prevents confusion.
Video
Steps
- Use resume to pick a previous session from the list, and continue to jump straight back to the latest one.
- When you want to try another direction without losing the current one, fork from the current session instead of starting over.
- Sessions can be exported and shared for documentation or review, keeping sensitive information out of the share.
- Clean up old sessions you no longer need, because a long list makes the right session hard to find.
Common pitfall: Resuming an old session without checking the code state can produce actions based on stale information; run git status before continuing.
Hands-on exercise: Create two sessions on the same project, return to the first with resume and record how context is preserved. Try a fork for an alternative direction.
Filmed demo · Video is added in the media phase
Recap
Comprehension check
When would you fork a session?
Recap
- resume and continue return to saved sessions
- Forking keeps both directions alive
- Clean up history periodically