[BUG] Desktop (Windows): claude://resume imports a CLI session that is still running (claude -p) and starts a second process on it
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 22/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- desktop
Research direction
The repro is fully specified, but the code named in the report (resumeCliSessionNow, importCliSession with its beforeWrite hook, liveOwnershipRefusal, the deep-link handler) lives in the bundled desktop build, not in this repository, so the first step is confirming whether any of that source is reachable here. Reproduce with claude -p --session-id <uuid> plus claude://resume?session=<uuid> and watch the .jsonl in ~/.claude/projects/<project>/ and main.log. Done looks like the deep link running the same live-ownership refusal as the in-app picker.
Written by the indexing model from the issue text.
Description
Environment
- Claude desktop 6.28899.2.0 (Windows 11, Microsoft Store/MSIX build)
- Claude Code 2.1.328 (bundled)
Summary
claude://resume?session=<id> imports a CLI session even while a headless claude -p --session-id <id> run is still writing it. The desktop copies the transcript as it is at that moment, shows it as idle, and starts its own Claude Code process on the same session about 0.1 s later. Two processes then own one session: they write to the same transcript (a duplicate or forked conversation), or the desktop shows a frozen copy while the run continues unseen.
The in-app resume picker checks for a live owner before importing and refuses. The deep-link path skips that check.
Steps to reproduce
- Start a long headless run:
claude -p --session-id <uuid> "<a task that takes a few minutes>". - While it is still running, open
claude://resume?session=<uuid>. - Watch the desktop session and
~/.claude/projects/<project>/<uuid>.jsonl.
Expected
The same behaviour as the in-app resume picker: refuse or wait while the session is running, or follow it read-only until the run ends and then hand it over.
Actual
main.log:
[info] Resume deep link: importing CLI session <id>
[info] Imported CLI session <id> as Desktop session local_<id>
[info] [CCD] Warming session local_<id>
[info] [CCD] Session local_<id> warmed successfully in 110ms
The desktop shows the snapshot as an idle session, and the headless process keeps appending to <id>.jsonl. If the user continues in the desktop, entries with entrypoint: "sdk-cli" and entrypoint: "claude-desktop" interleave in the same transcript.
Data (from 11 days of main.log and the transcripts)
- 71 resume links in total.
- 59 were opened after the headless run had ended. All continued cleanly, with no further
sdk-cliwrites after the import. - 11 links (10 sessions) were opened mid-run:
- 7 sessions got writes from both processes after the import. In 6 the writes were concurrent, for up to about 28 minutes (one run wrote 347 entries after the desktop had started its own process).
- 3 sessions showed a frozen snapshot while the run kept working for 1 to 5 minutes.
Notes from the bundled code (may be wrong)
- The resume picker path (
resumeCliSessionNow) callsimportCliSessionwith abeforeWritehook that runsliveOwnershipRefusaland turns a live owner into a refusal. - The deep-link handler calls
importCliSession(id)with no options, so no live-ownership check runs. The imported record is created withisRunning: false, and the session is warmed straight away.
Related
- #80773 (a resume link duplicates a session already open as a native Desktop tab)
- #99349 (a resume link handled twice breaks worktree sessions)
- Dominant language
- TypeScript
- Stars
- 156k
- Forks
- 25k
- Avg merge
- 16h 19m
- Merged PRs (30d)
- 5
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from anthropics/claude-code
-
area:vscode bug has repro platform:vscode platform:windows
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
anthropics/claude-code#111416 ·
-
area:plugins area:tui bug platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
anthropics/claude-code#111195 ·
-
area:docs area:security documentation enhancement platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
anthropics/claude-code#111180 ·
-
area:ide enhancement platform:macos platform:vscode
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
anthropics/claude-code#111172 ·
-
area:mcp bug has repro platform:linux platform:wsl
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
anthropics/claude-code#111077 ·
All issues in anthropics/claude-code
Similar issues
-
area: cli beginner beginner friendly bug community difficulty: easy dx easy first-timers-only good first issue hacktoberfest help wanted low-hanging fruit mentor available priority: P3 severity: low tech: typescript testing up-for-grabs ux
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
backlog-skill cat:docs documentation effort:s ready-for-agent sev:low
Difficulty 1/5 Under an hour Newbie friendliness 82/100
LucasSantana-Dev/Lucky#3284 ·
Maintainers usually reply within 1 day
-
area: backend bug priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
snapotter-hq/SnapOtter#5194 ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
homarr-labs/homarr#7671 ·
Maintainers usually reply within 1 day
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
openclaw/openclaw#203385 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day