A session is a persistent conversation between you and Claude Code. Sessions store your conversation history, file context, and any memory Claude has built up — so you can resume exactly where you left off.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/harshul786/claude-code-source/llms.txt
Use this file to discover all available pages before exploring further.
How sessions work
Each time you runclaude in a directory, a session is created and stored as a JSONL transcript file. Sessions are tied to your project directory and persist across terminal restarts.
The /session command
Use/session inside an interactive session to view your current session’s URL and QR code when connected in remote mode.
The
/session command shows a QR code link only when Claude Code is running in remote mode (started with --remote). In local mode it shows your current session info.Listing and resuming sessions
You can resume past sessions directly from the command line:/resume command:
Session management via the SDK
If you’re using the Claude Code SDK, you can manage sessions programmatically:Background sessions
Claude Code can run sessions in the background while you continue working. Background sessions are useful for long-running tasks like large refactors or test runs.Session storage
Sessions are stored locally as JSONL files. The default location is:| Platform | Path |
|---|---|
| macOS / Linux | ~/.claude/projects/<project-hash>/ |
| Windows | %APPDATA%\Claude\projects\<project-hash>\ |
Clearing and compacting
If a session grows too long, use/compact to summarize older context and free up space in the context window, or /clear to start a fresh conversation while staying in the same session.