[BUG] --resume picker does not show session when project path contains underscores

Status Fixed / completed
Reported on v2.1.119
Maintainer reply None cached
Activity 3 comments · opened Apr 30, 2026 · closed May 7, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When the working directory path contains underscores (e.g., D:\Desktop\workspace\xx_xx_xx), Claude Code encodes the path into the ~/.claude/projects/ folder name by converting underscores to hyphens (result: D--Desktop-xx-xx-xx.

The session file exists on disk and is valid, but claude --resume interactive picker does not list it.

Workaround: claude -r <session-id> works correctly.

Now I'm using claude --resume with the sessionId command to continue my work, but I need to go into the folder to get the session ID, which is very inconvenient.

dir info

Elliot@local /d/Desktop/workspace/feat_elliot_buy_esignbao_20260430 (feat_elliot_buy_esignbao_20260430)
$ pwd
/d/Desktop/workspace/feat_elliot_buy_esignbao_20260430

Elliot@local /d/Desktop/workspace/feat_elliot_buy_esignbao_20260430 (feat_elliot_buy_esignbao_20260430)
$ ll ~/.claude/projects/ | grep esignbao
drwxr-xr-x 1 Elliot 197121 0  4月 30 15:53 D--Desktop-workspace-feat-elliot-buy-esignbao-20260430/

What Should Happen?

Session appears in the picker regardless of underscores in path.

Error Messages/Logs

Steps to Reproduce

  1. cd into a directory with underscores in the path
  2. Start a Claude Code session, have a conversation
  3. Exit and run claude --resume
  4. The session does not appear in the picker

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.119

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

_No response_

View original on GitHub ↗

3 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/54865
  2. https://github.com/anthropics/claude-code/issues/54066
  3. https://github.com/anthropics/claude-code/issues/54542

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

0xbrainkid · 5 months ago

This is identity-matching fragility at the resume-project boundary.

If the --resume picker does not show a session when the project path contains underscores, then session discovery is depending on a path-handling assumption that treats a normal filesystem character as a lookup hazard.

Why it matters:

  • underscores are ordinary path characters, so users should not have to sanitize project names just to preserve resumability
  • when valid sessions disappear from the picker based on path shape, users experience the problem as nondeterministic continuity loss
  • resume/discovery surfaces need canonical project identity, not brittle string heuristics that collapse on common characters

I would want clarity on:

  1. whether underscores break indexing, serialization, path normalization, fuzzy matching, or UI filtering in the picker path
  2. whether the session is stored correctly but omitted from discovery, or whether the bad path handling corrupts identity earlier in the lifecycle
  3. whether resume matching can be based on canonical path identity / session id first, with display-friendly path text as a separate concern

Continuity features need robust identity semantics. If a normal underscore in the project path can hide a resumable session, the resume boundary is still too fragile for everyday workflows.

github-actions[bot] · 3 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.