{
  "id": 5905650,
  "title": "Keeping Claude Code sessions for your repository in one place",
  "url": "https://urgent.news/2026/09/06/keeping-claude-code-sessions-for-your-repository-in-one-place",
  "topic": "ai",
  "section": "AI",
  "published": "2026-09-06T04:17:55.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/scenee/keeping-claude-code-sessions-for-your-repository-in-one-place-3pj8"
  },
  "original_language": "en",
  "account": "Claude Code users can keep their code sessions organized by naming the project directory themselves. This fixes the issue where Claude Code creates a new folder for each working directory path, splitting session history across machines and git worktrees. By setting the CLAUDE_CODE_PROJECT_DIR_NAME environment variable, users can specify a custom folder name for their sessions. This requires Claude Code version 2.1.234 or later. The variable must be set in the shell environment that launches Claude Code, and direnv can automate this process by loading and unloading the variable as the user enters and leaves the repository directory. With this setup, sessions from the same project will live in a single, stable folder regardless of the machine or worktree, making it easier to share conversations across devices through Dropbox.",
  "summary": "I keep my Claude Code sessions in Dropbox so that I can pick up a conversation on another Mac. That works, but it comes with an annoyance: Claude Code names each project folder after the whole working directory path, so the moment a path differs even slightly — a different machine layout, or a git worktree — a brand new folder appears and the session history splits again.…",
  "key_points": [
    "Users can name project directory in Claude Code",
    "Set CLAUDECODEPROJECTDIRNAME env var",
    "Sessions stay in single folder across machines"
  ],
  "editors_take": "This update allows Claude Code users to consolidate their session history within a single, customizable folder, resolving issues with session fragmentation across devices and worktrees.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}