Todos should be project-specific, not globally shared

Resolved 💬 3 comments Opened Jul 22, 2025 by vanman2024 Closed Aug 19, 2025

Problem Description

Currently, all todo files are stored in a single shared directory (~/.claude/todos/) regardless of which project they belong to. This causes several issues:

Current Structure

~/.claude/
├── projects/
│   ├── -home-user-project1/         # Project-specific conversations ✓
│   └── -home-user-project2/         # Project-specific conversations ✓
└── todos/                           # ALL todos mixed together ✗
    ├── session1-todos.json         # Which project? Unknown
    └── session2-todos.json         # Which project? Unknown

Issues This Causes

  1. Cross-Project Contamination: When recovering a session, todos from completely unrelated projects appear, causing confusion. For example, "issues 116-120" from one project showing up when working on a different repository.
  1. No Project Context: Todo filenames only contain session IDs with no project identifier, making it impossible to determine which project they belong to.
  1. Session Recovery Problems: The recovery process (ls -t ~/.claude/todos/*.json) returns todos from ALL projects, not just the current one.
  1. Scale Issues: With hundreds of accumulated todo files, finding project-relevant ones becomes impossible.

Proposed Solution

Todos should be stored in project-specific directories, mirroring the existing conversation log structure:

~/.claude/
└── projects/
    ├── -home-user-project1/
    │   ├── conversations/
    │   │   └── session1.jsonl
    │   └── todos/
    │       └── session1-todos.json
    └── -home-user-project2/
        ├── conversations/
        └── todos/

Benefits

  1. Project Isolation: Each project's todos remain separate
  2. Better Recovery: Session recovery only finds relevant todos
  3. Cleaner Organization: Matches the existing project-based structure
  4. Prevents Data Loss: When cleaning up one project, won't accidentally delete todos from another

Implementation Notes

The TodoWrite tool would need to be updated to:

  1. Determine the current project context
  2. Write to ~/.claude/projects/{project-path}/todos/ instead of ~/.claude/todos/
  3. Session recovery should look in the project-specific directory

This change would significantly improve the developer experience when working on multiple projects with Claude Code.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗