Claude Code / Use
Manage Claude Code sessions
A session is a container for task context. A good conversation should have a single goal, a clear record, and the ability to continue relaying.

What is a session
A Claude Code session saves the conversation, context, plan, tool calls, and results of a task. Only by understanding session management can you avoid losing state during long tasks, parallel tasks, and resume work.
Official session documentation covers naming, continuing, reverting, branching, retrieving from PRs, exporting transcripts, and local storage locations. For learners, the important thing is to limit a session to a clear goal.
continue and resume
Common entry points include continuing a recent session, resuming from a historical session, resuming from a PR-associated session, and selecting with /resume. After recovery, Claude should be asked to review the status before continuing.
| action | Purpose | Suggestions |
|---|---|---|
| --continue | Continue the most recent conversation. | Suitable for just leaving and coming back. |
| --resume | Select or specify from historical sessions. | Suitable for multi-tasking switching. |
| --from-pr | Retrieve related conversations from PR. | Good to go back to PRs that Claude created or participated in. |
| /resume | Interactive recovery selector. | Good for switching within the CLI. |
Naming and exporting
Naming important conversations can reduce subsequent search costs; exporting transcripts can be used for review, handover, troubleshooting errors, or settling team processes.
- Before restoring, ask Claude to summarize: target, changed files, executed commands, and remaining risks.
- Don’t cram multiple unrelated tasks into the same session.
- Keep transcripts for important fixes so you can track why they were changed.
claude --name "checkout-bug-fix"
/rename checkout-bug-fix
/resumeComplete usage points
Supplement the core concepts, operation sequences, permission boundaries and verification requirements that are easily compressed and missed in official documents, making it easier for English readers to learn completely by page.
Session management supplement
Sessions are Claude Code's task containers. A good conversation should have a single goal, clear context, recoverability, and exportability. Long tasks and parallel tasks are most prone to errors due to session mixing.
Before continuing the session, have Claude recap: Goal, files modified, commands run, current failure point, remaining risk. When restoring historical sessions, retrieving sessions from PR, or exporting transcripts, you must confirm whether the current repository status and session records are consistent.
Don't work on multiple unrelated goals at the same time in a session. When parallelism is required, multiple sessions or subagents are divided into multiple sessions, and finally the main session is unified to merge and verify.
Study Checklist
Put the content on this page into real tasks and use the five dimensions of entry, context, permissions, verification and team rules to check whether you have truly mastered it.
Study Checklist
After reading this page, do not just remember the concept name. You should be able to place "Manage Claude Code sessions" back into a real Claude Code engineering workflow: where the task starts, what context the system loads, which actions need approval, how the result is verified, and how to roll back when it fails.
If this is a portal or platform page, specifically confirm what contexts this portal can access: local files, cloud repositories, browser logins, team messages, external tools, and whether these contexts are sufficient to complete the verification.
- Be able to describe in your own words the specific problem this page solves, rather than just reciting the title.
- Able to write a minimal example task with goals, scope, prohibitions, and acceptance criteria.
- Be able to determine which information should be put into the current prompt and which should be captured as project rules or configurations.
- Be able to explain which long-term rules should go into CLAUDE.md, and which runtime behavior should be handled by settings, permissions, Hooks, Skills and MCP.
- Ability to check diffs, command output, test results, screenshots or PR notes after a task is completed instead of just trusting the natural language summary.
If this page is used for team training, ask learners to complete a small task with Claude Code: read and explain first, submit a plan, make the smallest useful change, and close with real verification commands plus human diff review.