﻿# Why a Claude Code session is tied to a project directory

Understand how Claude Code session selection relates to the project directory, saved transcripts and continuation commands when resuming repository work.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/learn-claude-session-directory/
Language: en

Returning to a coding task involves both conversation state and repository state. Claude Code provides continuation and session-selection commands, while saved transcripts organize earlier work. Understanding the directory relationship helps avoid a familiar-looking conversation being resumed against a checkout whose files have changed since the last observation.

## Choose continuation deliberately

The documented CLI supports continuing a recent conversation and selecting a saved session with resume options. An interactive session picker offers another entry point. Choose the conversation that owns the unfinished task rather than relying on a similar title. For a hypothetical indexer repair, the useful history includes the accepted failure input and candidate patch, not merely any earlier discussion of indexing.

## Verify the working directory

A repository directory determines which local files and instructions the running process can encounter. Before continuing an edit, identify the active checkout and compare it with the previous task record. A different worktree may have the same project name while containing another patch. The transcript can explain the old investigation, but it does not make the current directory identical to the one used during that investigation.

## Recheck observations that may have changed

A remembered test failure may have been fixed by a later commit. A previously running server may have stopped. For the indexer example, reread the relevant code and rerun the narrow reproduction if the repository advanced. This is not restarting the whole task; it is refreshing the evidence whose validity depended on local state. Preserve accepted requirements while checking observations that are inherently temporary.

## Name sessions for retrieval

Session naming helps distinguish an investigation from a later implementation or review. Prefer a label describing the concrete behavior, such as escaped-path indexing, over a broad project name shared by many tasks. The label is for retrieval rather than a substitute for identifiers and revision evidence. A short handoff record can connect the human-readable name with the files and checks that matter.

## Keep platform differences visible

Claude Code is available through multiple surfaces, and their session lists and handoff capabilities are documented separately. Do not assume that every local transcript appears automatically in every interface. When moving work, use the supported handoff or resume mechanism and verify the resulting environment. The goal is a coherent continuation of the same task, with conversation context and repository evidence connected rather than silently conflated.

## Documentation and further study

- [Manage sessions](https://code.claude.com/docs/en/sessions).

- [How Claude Code works](https://code.claude.com/docs/en/how-claude-code-works).

- [Extend Claude Code](https://code.claude.com/docs/en/features-overview).

Related engineering guides: [Reproducible inference stacks: preserving a GPU pilot’s result](/journal/software-stack-reproducibility/); [Choose a local AI stack: desktop chat, shared UI or coding agent](/journal/local-ai-app-stack-selection/).
