[BUG] Sessions panel hides conversations when session started in a parent/child directory of the current workspace
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?
Environment:
Claude Code extension: anthropic.claude-code v2.1.141 (darwin-arm64)
Editor: Cursor on macOS
CLI: @anthropic-ai/claude-code (installed via npm), also ~/.local/bin/claude
Expected behavior:
When I open a workspace in Cursor, the Claude Code "Local" sessions panel should list every conversation I've had that is relevant to that workspace — i.e., every session whose cwd (at any point in the transcript) is the workspace folder, an ancestor I cd'd down from, or a descendant. As a user I think in terms of "this project" or "this workspace," not "the exact directory I happened to launch the CLI from."
Actual behavior:
The panel only lists transcripts stored in the single project folder under ~/.claude/projects/ whose encoded name matches the current workspace path exactly. If a session was started while my shell was in a parent directory and I later cd'd into the project, the transcript is filed under the parent directory's project folder and never appears in the panel for the project I actually worked on.
Suggested fix (any of these would resolve it):
When cwd changes mid-session, also write the transcript into the new directory's project folder (or move it there at session end).
Have the panel index transcripts by any cwd that appears in the file, not just by the filename's encoded path.
Add a "workspace-wide" toggle to the panel that, in addition to the strict-cwd match, surfaces sessions whose recorded cwd is a descendant of, or contains, the current workspace.
Impact:
This isn't a data-loss bug — the transcripts are safe on disk — but it makes the sessions panel unreliable for finding past conversations. After installing the plugin three days ago I expected to see all of my conversations from that project in one place. Two of eleven appearing on the Local tab made me think the plugin was silently dropping history.
What Should Happen?
Expected behavior:
When I open a workspace in Cursor, the Claude Code "Local" sessions panel should list every conversation I've had that is relevant to that workspace — i.e., every session whose cwd (at any point in the transcript) is the workspace folder, an ancestor I cd'd down from, or a descendant. As a user I think in terms of "this project" or "this workspace," not "the exact directory I happened to launch the CLI from."
Error Messages/Logs
{"type":"queue-operation","cwd":null,"timestamp":"2026-05-14T15:56:21.989Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"queue-operation","cwd":null,"timestamp":"2026-05-14T15:56:22.001Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"attachment","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:55:55.313Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"attachment","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:55:55.532Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"attachment","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:55:55.532Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"user","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:56:22.018Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"user","content_kind":["text"]}
{"type":"attachment","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:56:22.017Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"attachment","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:56:22.017Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"attachment","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:56:22.017Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"file-history-snapshot","cwd":null,"timestamp":null,"sessionId":null,"role":null,"content_kind":null}
{"type":"last-prompt","cwd":null,"timestamp":null,"sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"ai-title","cwd":null,"timestamp":null,"sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"assistant","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:56:24.865Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"assistant","content_kind":["thinking"]}
{"type":"assistant","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:56:25.148Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"assistant","content_kind":["tool_use"]}
{"type":"user","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:56:27.719Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"user","content_kind":["tool_result"]}
{"type":"assistant","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:56:37.712Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"assistant","content_kind":["thinking"]}
{"type":"assistant","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:56:39.915Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"assistant","content_kind":["text"]}
{"type":"queue-operation","cwd":null,"timestamp":"2026-05-14T15:56:58.255Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"queue-operation","cwd":null,"timestamp":"2026-05-14T15:56:58.255Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"system","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:56:39.966Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"user","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:56:58.258Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"user","content_kind":["text"]}
{"type":"file-history-snapshot","cwd":null,"timestamp":null,"sessionId":null,"role":null,"content_kind":null}
{"type":"assistant","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:57:03.060Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"assistant","content_kind":["thinking"]}
{"type":"assistant","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:57:03.660Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"assistant","content_kind":["tool_use"]}
{"type":"user","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:57:03.800Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"user","content_kind":["tool_result"]}
{"type":"last-prompt","cwd":null,"timestamp":null,"sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"ai-title","cwd":null,"timestamp":null,"sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"assistant","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:57:06.604Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"assistant","content_kind":["tool_use"]}
{"type":"user","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:57:06.652Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"user","content_kind":["tool_result"]}
{"type":"assistant","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:57:08.902Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"assistant","content_kind":["tool_use"]}
{"type":"user","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:57:08.959Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"user","content_kind":["tool_result"]}
{"type":"assistant","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:57:11.570Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"assistant","content_kind":["tool_use"]}
{"type":"user","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:57:11.624Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"user","content_kind":["tool_result"]}
{"type":"assistant","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:57:14.158Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"assistant","content_kind":["tool_use"]}
{"type":"user","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:57:14.203Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"user","content_kind":["tool_result"]}
{"type":"assistant","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:57:17.174Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"assistant","content_kind":["tool_use"]}
{"type":"user","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:57:17.223Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"user","content_kind":["tool_result"]}
{"type":"assistant","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:57:22.638Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"assistant","content_kind":["thinking"]}
{"type":"assistant","cwd":"/Users/danyshapiro/cursorWorkspace","timestamp":"2026-05-14T15:57:23.167Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"assistant","content_kind":["tool_use"]}
{"type":"user","cwd":"/Users/danyshapiro/cursorWorkspace/linkscout","timestamp":"2026-05-14T15:57:27.888Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"user","content_kind":["tool_result"]}
{"type":"assistant","cwd":"/Users/danyshapiro/cursorWorkspace/linkscout","timestamp":"2026-05-14T15:57:35.769Z","sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":"assistant","content_kind":["text"]}
{"type":"last-prompt","cwd":null,"timestamp":null,"sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"ai-title","cwd":null,"timestamp":null,"sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"ai-title","cwd":null,"timestamp":null,"sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"ai-title","cwd":null,"timestamp":null,"sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"ai-title","cwd":null,"timestamp":null,"sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"ai-title","cwd":null,"timestamp":null,"sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"ai-title","cwd":null,"timestamp":null,"sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"ai-title","cwd":null,"timestamp":null,"sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
{"type":"ai-title","cwd":null,"timestamp":null,"sessionId":"da43519f-3fe6-469f-af00-53657b454509","role":null,"content_kind":null}
Steps to Reproduce
Reproduction:
cd ~/cursorWorkspace && claude — start a session here.
Inside the session: cd linkscout and do real work on the linkscout project.
End session. The transcript writes to ~/.claude/projects/-Users-danyshapiro-cursorWorkspace/<uuid>.jsonl.
Open Cursor with ~/cursorWorkspace/linkscout/ as the workspace.
Open the Claude Code sessions panel → that session is not in the list, even though every meaningful turn happened in linkscout/.
In my case I have 9 transcripts under ~/.claude/projects/-Users-danyshapiro-cursorWorkspace/ and 3 of them are entirely about my linkscout/ subdirectory — the panel hides all 3. I worked around it by symlinking the 3 files into the linkscout project folder, but that's manual and breaks every time it happens.
Evidence in the transcripts:
The "misfiled" transcripts contain entries with cwd = /Users/danyshapiro/cursorWorkspace/linkscout alongside the original parent cwd, and one has the explicit line Shell cwd was reset to /Users/danyshapiro/cursorWorkspace/linkscout. So the data needed to associate the session with the linkscout project is already in the file — it's just not used.
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
anthropic.claude-code v2.1.141 (darwin-arm64)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Cursor
Additional Information
<head></head><h3 style="font-style: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-line: none; text-decoration-thickness: initial; text-decoration-style: initial; color: rgb(204, 204, 204); font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; font-variant-ligatures: normal; background-color: rgb(31, 31, 31); text-decoration-color: initial;">Evidence — three transcripts filed under the wrong project folder</h3><p style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-line: none; text-decoration-thickness: initial; text-decoration-style: initial; margin-top: 0.1em; margin-bottom: 0.2em; color: rgb(204, 204, 204); font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; font-size: 13px; font-variant-ligatures: normal; background-color: rgb(31, 31, 31); text-decoration-color: initial;">All three of these <code style="font-family: monospace; color: rgb(208, 208, 208); background-color: rgb(60, 60, 60); padding: 2px 4px; border-radius: 3px; word-break: break-word; font-size: 0.9em;">.jsonl</code> files are physically stored in the project folder for <code style="font-family: monospace; color: rgb(208, 208, 208); background-color: rgb(60, 60, 60); padding: 2px 4px; border-radius: 3px; word-break: break-word; font-size: 0.9em;">~/cursorWorkspace/</code> (because that's where the CLI was launched), but every one of them contains entries whose recorded <code style="font-family: monospace; color: rgb(208, 208, 208); background-color: rgb(60, 60, 60); padding: 2px 4px; border-radius: 3px; word-break: break-word; font-size: 0.9em;">cwd</code> is <code style="font-family: monospace; color: rgb(208, 208, 208); background-color: rgb(60, 60, 60); padding: 2px 4px; border-radius: 3px; word-break: break-word; font-size: 0.9em;">~/cursorWorkspace/linkscout</code> (the actual workspace I was working on). Counts come from <code style="font-family: monospace; color: rgb(208, 208, 208); background-color: rgb(60, 60, 60); padding: 2px 4px; border-radius: 3px; word-break: break-word; font-size: 0.9em;">jq -r '.cwd' <file> | sort | uniq -c</code>:</p>
File location on disk | Entries with cwd = .../cursorWorkspace | Entries with cwd = .../cursorWorkspace/linkscout
-- | -- | --
~/.claude/projects/-Users-danyshapiro-cursorWorkspace/b66f24f1-…jsonl | 209 | 39
~/.claude/projects/-Users-danyshapiro-cursorWorkspace/36a34039-…jsonl | 149 | 50
~/.claude/projects/-Users-danyshapiro-cursorWorkspace/da43519f-…jsonl | 29 | 2
<p style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-line: none; text-decoration-thickness: initial; text-decoration-style: initial; margin-top: 0.1em; margin-bottom: 0.2em; color: rgb(204, 204, 204); font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; font-size: 13px; font-variant-ligatures: normal; background-color: rgb(31, 31, 31); text-decoration-color: initial;">So 91 messages were exchanged with <code style="font-family: monospace; color: rgb(208, 208, 208); background-color: rgb(60, 60, 60); padding: 2px 4px; border-radius: 3px; word-break: break-word; font-size: 0.9em;">cwd = ~/cursorWorkspace/linkscout</code>, but because each file's filename location is determined by the <strong>starting</strong> cwd of the session, none of these sessions appear in the Local sessions panel when Cursor's workspace is <code style="font-family: monospace; color: rgb(208, 208, 208); background-color: rgb(60, 60, 60); padding: 2px 4px; border-radius: 3px; word-break: break-word; font-size: 0.9em;">~/cursorWorkspace/linkscout/</code>. The panel only reads <code style="font-family: monospace; color: rgb(208, 208, 208); background-color: rgb(60, 60, 60); padding: 2px 4px; border-radius: 3px; word-break: break-word; font-size: 0.9em;">~/.claude/projects/-Users-danyshapiro-cursorWorkspace-linkscout/</code>.</p><p style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-line: none; text-decoration-thickness: initial; text-decoration-style: initial; margin-top: 0.1em; margin-bottom: 0.2em; color: rgb(204, 204, 204); font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; font-size: 13px; font-variant-ligatures: normal; background-color: rgb(31, 31, 31); text-decoration-color: initial;">Minimal repro snippet — extracting cwd-change moments from one of the files:</p><div class="codeBlockWrapper_-a7MRw" style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-line: none; text-decoration-thickness: initial; text-decoration-style: initial; position: relative; margin: 8px 0px; color: rgb(204, 204, 204); font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; font-size: 13px; font-variant-ligatures: normal; background-color: rgb(31, 31, 31); text-decoration-color: initial;"><button class="copyButton_CEmTFw copyButton_-a7MRw" title="Copy code" aria-label="Copy code to clipboard" style="color: rgb(204, 204, 204); font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; font-size: 13px; background: 0% 0% repeat rgb(31, 31, 31); border: 0.694444px solid rgb(69, 69, 69); cursor: pointer; opacity: 0; display: flex; border-radius: 4px; justify-content: center; align-items: center; padding: 4px; transition: opacity 0.15s, background 0.15s; position: absolute; top: 4px; right: 4px;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" data-slot="icon" class="copyIcon_CEmTFw"><path fill-rule="evenodd" d="M15.988 3.012A2.25 2.25 0 0 1 18 5.25v6.5A2.25 2.25 0 0 1 15.75 14H13.5v-3.379a3 3 0 0 0-.879-2.121l-3.12-3.121a3 3 0 0 0-1.402-.791 2.252 2.252 0 0 1 1.913-1.576A2.25 2.25 0 0 1 12.25 1h1.5a2.25 2.25 0 0 1 2.238 2.012ZM11.5 3.25a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 .75.75v.25h-3v-.25Z" clip-rule="evenodd"></path><path d="M3.5 6A1.5 1.5 0 0 0 2 7.5v9A1.5 1.5 0 0 0 3.5 18h7a1.5 1.5 0 0 0 1.5-1.5v-5.879a1.5 1.5 0 0 0-.44-1.06L8.44 6.439A1.5 1.5 0 0 0 7.378 6H3.5Z"></path></svg></button><pre style="overflow-x: auto; white-space: pre; box-sizing: border-box; border-radius: 4px; max-width: 100%; margin: 0px; padding: 8px;"><code class="language-bash" style="font-family: monospace; color: rgb(208, 208, 208); background-color: rgb(60, 60, 60); padding: 0px; border-radius: 3px; word-break: break-word; font-size: 0.9em;">$ jq -c 'select(.cwd == "/Users/danyshapiro/cursorWorkspace/linkscout") | {ts: .timestamp, cwd, type}' \
~/.claude/projects/-Users-danyshapiro-cursorWorkspace/da43519f-*.jsonl | head -2
{"ts":"2026-05-14T15:57:27.888Z","cwd":"/Users/danyshapiro/cursorWorkspace/linkscout","type":"user"}
{"ts":"2026-05-14T15:57:35.769Z","cwd":"/Users/danyshapiro/cursorWorkspace/linkscout","type":"assistant"}
</code></pre></div><p style="font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre-wrap; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-line: none; text-decoration-thickness: initial; text-decoration-style: initial; margin-top: 0.1em; margin-bottom: 0.2em; color: rgb(204, 204, 204); font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; font-size: 13px; font-variant-ligatures: normal; background-color: rgb(31, 31, 31); text-decoration-color: initial;">The transcript clearly knows where work was happening — the panel just doesn't use that information when deciding what to display.</p>
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗