[BUG] Desktop (Windows): claude://resume imports a CLI session that is still running (claude -p) and starts a second process on it
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 22/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- desktop
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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)
- Lingua principale
- TypeScript
- Stelle
- 156k
- Fork
- 25k
- Merge medio
- 16h 19m
- PR unite (30g)
- 5
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di anthropics/claude-code
-
area:vscode bug has repro platform:vscode platform:windows
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
anthropics/claude-code#111416 ·
-
PromptHint: engine draws " · " after the mode label even when a hook's rewritten hint is emptyApertaarea:plugins area:tui bug platform:macos
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
anthropics/claude-code#111195 ·
-
area:docs area:security documentation enhancement platform:macos
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
anthropics/claude-code#111180 ·
-
area:ide enhancement platform:macos platform:vscode
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
anthropics/claude-code#111172 ·
-
area:mcp bug has repro platform:linux platform:wsl
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
anthropics/claude-code#111077 ·
Tutte le issue di anthropics/claude-code
Issue simili
-
The manager preset saves launch definitions without the required file and digest pairForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno