Repository navigation
fix(ai-vault): resume Claude sessions from their start directory - #9499
Merged
Merged
Conversation
Contributor
📝 WalkthroughWalkthroughThe session accumulator now sets 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The AI Vault session scanner recorded a session's cwd by overwriting it with every transcript record that carried one, so a session that changed working directory mid-run ended up with its last-seen cwd. That value drives the resume command (cd <cwd> && claude --resume <id>) and the history panel's grouping and filtering. For Claude this breaks resume: transcripts live under ~/.claude/projects/<slug-of-start-dir>/, and claude --resume <id> only searches the project dir derived from the current cwd, so resuming from the drifted cwd fails with "No conversation found". Capture the first-seen (start) cwd instead, which transcripts write up front; this fixes resume, grouping, and filtering at once. updateLatestLocation is only used by the Claude parser, so no other agent is affected. Fixes stablyai#9361
nwparker
force-pushed
the
fix/claude-resume-start-cwd
branch
from
July 23, 2026 11:49
6072665 to
e8033a8
Compare
Contributor
|
Thanks so much for this, @choihjin — resume Claude sessions from their start directory. Verified (fail-on-main/pass-on-branch), rebased on latest |
This was referenced Jul 27, 2026
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…blyai#9499) The AI Vault session scanner recorded a session's cwd by overwriting it with every transcript record that carried one, so a session that changed working directory mid-run ended up with its last-seen cwd. That value drives the resume command (cd <cwd> && claude --resume <id>) and the history panel's grouping and filtering. For Claude this breaks resume: transcripts live under ~/.claude/projects/<slug-of-start-dir>/, and claude --resume <id> only searches the project dir derived from the current cwd, so resuming from the drifted cwd fails with "No conversation found". Capture the first-seen (start) cwd instead, which transcripts write up front; this fixes resume, grouping, and filtering at once. updateLatestLocation is only used by the Claude parser, so no other agent is affected. Fixes stablyai#9361
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resuming a Claude session that changed directories mid-run no longer fails with "No conversation found" — sessions now resume from their original start directory.
ELI5
If you started a chat in one folder and later moved into a subfolder, the "resume" button used to point at the wrong folder and couldn't find your conversation. Now it always remembers where you began, so resume just works.
Root cause & fix
The AI Vault session scanner recorded each session's
cwdby overwriting it with every transcript record, so a session that drifted into a subdirectory ended up with its last-seen cwd. Claude stores transcripts under~/.claude/projects/<slug-of-start-dir>/andclaude --resume <id>only searches the project dir derived from the current cwd, so the rebuiltcd '<subdir>' && claude --resume <id>ran from the wrong place and failed. The fix captures the first-seen (start) cwd instead — transcripts are append-only and write the cwd up front, so the first record carrying one is the true start directory. This is fixed at the accumulator, the single source ofsession.cwd, repairing resume, folder grouping, and workspace filtering at once.Evidence
Validated & rebased onto latest main during a bug-bash triage on 2026-07-23.
src/main/ai-vault/session-scanner-accumulator.ts(fix) andsrc/main/ai-vault/session-scanner-claude-cwd-drift.test.ts(test).session-scanner-claude-cwd-drift.test.tspasses on branch: Test Files 1 passed (1); Tests 1 passed (1).oxlinton the fix file reported no warnings or errors.Trade-offs
None — pure fix.
Regression risk
Zero-regression:
updateLatestLocationis called only by the Claude parser, so no other agent's behavior changes. The branch still tracks the latest location for its own use; only the persistedsession.cwdderivation changes. Non-affected paths are byte-identical, and correctness is proven by the passing test plus the fail-on-revert assertion.Credit to original author @choihjin (Gideon). Validated, rebased, and (where applicable) hardened via automated bug-bash review; original fix design preserved.