[BUG] New session on claude.ai/code environment silently falls back to submitting the prompt into the most recent existing session

Status Open
Reported on v2.1.219
Maintainer reply None cached
Activity 0 comments · opened Aug 4, 2026

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?

When creating a new session for a claude.ai/code cloud environment, the new session is never actually created. Instead, the UI silently routes focus — and submits the typed prompt — into the environment's most recent non-archived session. The prompt lands in an unrelated, in-progress conversation, contaminating that session's work.

Evidence that the failure is on the claude.ai platform side, not the environment server:

  • While capturing the environment server's CLI output live, I attempted new-session creation: no request reached the environment server at all (session list and capacity 1/32 completely unchanged).
  • Controlled repro (2026-08-03 23:31, desktop app): 5 consecutive new-session attempts all routed to the same pinned "active" session; zero API errors logged during repro.
  • Reproduces identically on the Windows desktop app, claude.ai in a browser, and the mobile app (on mobile the input is rejected instead of misrouted) → not an app-cache/webview/server issue.

Things that do NOT fix it (all verified):

  • Full restart of the environment server
  • Restarting the desktop app
  • Logout → re-login
  • Archiving the pinned session: works only once — the "active session" pin moves to the next most-recent session and the misrouting resumes
  • Local session cleanup (archived 25 stale local sessions)

Environment ID: env_0137zihmv5n7Ym5nbFKNfgnE. First observed 2026-08-03, still reproducing as of 2026-08-04.

What Should Happen?

A new session_01... should be created for the selected environment and the prompt should start a fresh conversation in it.

Error Messages/Logs

No API errors during repro. Side observation: the desktop app repeatedly polls stale environment IDs that no longer exist, getting 404s (distinct stale IDs from Jul 21, Jul 25, Jul 27, Aug 3) — stale environment references appear to persist in the webview cache. Logs available: %APPDATA%\Claude\logs\main.log (setFocusedSession traces), claude.ai-web.log.

Steps to Reproduce

  1. Have a claude.ai/code cloud environment with at least one existing (non-archived) session.
  2. From the sidebar (desktop app or claude.ai web), create a new session for that environment.
  3. Type a prompt and submit.
  4. Observe: no new session ID is created; the UI switches to the environment's most recent existing session and submits the prompt there.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.219 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

Desktop app for Windows 1.24012.9.0 (MS Store), embedded runtime 2.1.219 — same version as the environment server CLI.

Possibly related (but distinct) session-routing issues: #77157 (iOS spawns multiple sessions per prompt), #27658 (parallel desktop sessions all execute the last prompt). This report is the opposite failure: the new session is never created and the prompt is injected into an existing one.

View original on GitHub ↗