anthropics / anthropics/claude-code

[BUG] Desktop app (macOS 1.52386.6): "+ New" re-focuses the previous session instead of creating one; message is delivered to the old session

未关闭
#94,419 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:desktop bug platform:macos
主要语言
Python
星标
145k
派生
23.1k
PR 合并指标
PR 指标待抓取

描述

## Summary

In the Claude Desktop app (macOS) Code tab, clicking **"+ New"** does not create a new session. The app shows the empty new-session composer for a moment, then **re-focuses the previously active session in the same second**, and the message typed into the "new" composer is delivered to that old session. No new session appears in the sidebar, no new transcript file is written, and (for a Remote Control environment) the `claude remote-control` server never receives a spawn request.

This looks like a heavier variant of #93709 ("+New" inherits the previous *project*): here "+New" resolves to the previous *session itself*.

## Environment

- Claude Desktop **1.52386.6** (auto-updated from 1.49585.0 within the last few days)
- Bundled CCD: `[CCD] Initialized with version 2.1.270`
- macOS 26.4 (25E246), Apple Silicon
- Sessions are created in a **Remote Control environment** hosted on the same Mac: `claude remote-control --name ... --spawn same-dir` (CLI 2.1.263) running in tmux; 17/32 sessions attached, status "Connected".

## Steps to reproduce

1. Open the Code tab, have a session focused (session A).
2. Click **+ New** in the sidebar (environment = the Remote Control environment).
3. Type any message (e.g. "test") and send.

**Expected:** a new session is created; a new row appears in the sidebar; the message goes to the new session.

**Actual:** the composer bounces back to session A; the message is delivered to session A; the sidebar shows no new row.

Reproduced 6 times within ~15 minutes, including **after a full Cmd+Q restart of the app** (restart did not help). Interestingly, "+ New" *did* work three times earlier in the same hour, so it is intermittent / state-dependent.

## Log evidence (`~/Library/Logs/Claude/main.log`, local time)

Working case (earlier the same morning) — `null` then a **new** session id a few seconds later:

```
10:00:54 [CCD] LocalSessions.setFocusedSession: sessionId=null
10:00:58 [CCD] LocalSessions.setFocusedSession: sessionId=null
10:00:58 [CCD] LocalSessions.setFocusedSession: sessionId=session_01GZCZ… <- new id
10:01:20 [CCD] LocalSessions.setFocusedSession: sessionId=null
10:01:26 [CCD] LocalSessions.setFocusedSession: sessionId=session_01JjBE… <- new id (session A)
```

Failing case — `null` then the **same old** session id within the same second, every time:

```
10:13:04 [CCD] LocalSessions.setFocusedSession: sessionId=null
10:13:06 [CCD] LocalSessions.setFocusedSession: sessionId=session_01JjBE… <- session A again
10:13:06 handoff: publishing session_01JjBE…
10:21:04 Starting app <- full restart (Cmd+Q)
10:21:22 [CCD] LocalSessions.setFocusedSession: sessionId=null
10:21:22 [CCD] LocalSessions.setFocusedSession: sessionId=session_01JjBE… <- session A again
10:27:36 … same pattern
10:28:47 … same pattern
```

Server/host side during the failing window:
- `~/.claude/projects//` gets **no new `*.jsonl`**; the old session's transcript grows with the misrouted user messages.
- `claude remote-control` (tmux) logs nothing — no new child process (`claude --print --sdk-url …`) is spawned, capacity stays 17/32.

## Impact

Messages meant for a fresh conversation silently land in an unrelated existing conversation (I sent a "test" and then a real request into a finished, unrelated session before noticing). There is no error or indication in the UI.

## Workarounds that do work

- Start the session from an external terminal (`cd && claude --remote-control ""`) — same workaround as #93709.
- iPhone app "new session" with the Remote Control environment selected.

## Related

- #93709 — "+New" creates a session bound to the previous project (WSL). Same "+New inherits previous state" family; this report is macOS and binds to the previous *session*.
- #93834 — sidebar sessions vanish after 1.49585 -> 1.52386 (same update).

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。