Skip to content

[BUG] Active session auto-archives within seconds of window focus loss (Windows) #57602

Description

@eddyafram

What happened

An active Claude Code Desktop session auto-archives itself within seconds of the app losing window focus (e.g., alt-tab to a browser to look at a URL, return after ~30 s, find the session marked "This session is archived, to restart it click unarchive"). Has occurred 2+ times in the same continuous work session today.

The session was unambiguously not idle — it was mid-conversation with the assistant actively working on a multi-file feature.

Repro steps

  1. Start a Claude Code Desktop session in a project directory
  2. Have a multi-turn conversation (this happens after the session has been alive for ~hours)
  3. Alt-tab to another window (browser, etc.) for less than a minute
  4. Return to Claude Code

Expected: session is exactly where I left it.
Actual: session pane shows "This session is archived, to restart it, click unarchive."

Diagnostic info

  • OS: Windows 11 Pro 26200
  • Approximate time of latest occurrence: ~12:25 UTC, 2026-05-09
  • Session UUID: available on request (happy to share privately with Anthropic engineering — don't want to post a session identifier in a public thread)
  • Local config ruled out: no Stop / SessionStart / archive hooks in user settings.json, no settings.local.json, no keybindings.json, no scheduled tasks. No mechanism in the user's local config calls archive_session.

Related

Possibly the same root cause as #24534 ("Archived Code sessions not visible on Windows"), but the trigger here is much more specific — focus loss within seconds, not "vanished overnight."

Workaround

Manually click "Unarchive." Conversation state is preserved (the JSONL on disk is intact); only the UI pointer is broken.

Activity

  1. changed the title [-]Active session auto-archives within seconds of window focus loss (Windows)[/-] [+][BUG] Active session auto-archives within seconds of window focus loss (Windows)[/+] on May 9, 2026
  2. github-actions commented on May 9, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. Desktop app: chats moved from Archived back to Active are auto-archived again after ~1 second #57586
    2. Desktop app (Windows): background sessions pause and timer resets when switching to another session #48045
    3. [BUG] Archived Code sessions not visible in Archive filter on Claude Desktop (Windows) #24534

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  3. eddyafram commented on May 9, 2026

    @eddyafram
    Author

    What happened (corrected)

    Active session auto-archives after ~3 minutes of user idleness, with Claude Code Desktop in foreground focus. Initially suspected this was focus-loss-triggered, but observed it occurring while the app remained the active window — user simply stepped away from the keyboard. The assistant was actively generating a response at the time of archival.

    Revised repro

    1. Start a Claude Code Desktop session
    2. Have a multi-turn conversation (~hours-old session)
    3. Stop typing — leave the app in focus, do not interact for ~3 minutes
    4. Return

    Expected: session is exactly where I left it.
    Actual: session pane shows "This session is archived, to restart it, click unarchive."

    Reproduced twice today within minutes. Not focus-related; idle-only.

  4. satayutata commented on May 11, 2026

    @satayutata

    +1, hitting this exact behavior on Windows 10 Home 19045.6466 with Claude Code Desktop running Opus 4.7.

    Frequency in one continuous work session today (2026-05-11): auto-archived 3 times during a single project conversation. Each time required clicking Unarchive to continue.

    Specific trigger pattern I noticed:
    The archives all happened during periods where Claude was waiting on long-running background tasks — specifically gh pr merge --auto waiting on a Codex Cloud audit (~3-5 min each) and codex exec review runs (~4 min each). During those waits the user (me) tab-switches to read other things, returns, and the session is archived. So the focus-loss trigger noted in the original report seems compounded by long quiet periods on the assistant side.

    Conversation state preservation: confirmed intact. Unarchiving restores the full multi-turn conversation, including pending tool results. So this really does feel like a UI pointer issue, not a state loss issue.

    Workaround that helped me a bit: typing any short message (even "ok" or "รอก่อน") before tab-switching seems to defer the archive. Doesn't always work though.

    Happy to share session UUIDs privately to Anthropic engineering if useful — just say where to send them.

  5. acyberduck commented on May 11, 2026

    @acyberduck

    +1, hitting same behavior on MacOS with Claude 1.6608.2 (ebf1a1) 2026-05-08T23:17:27.000Z

  6. allhuggermugger commented on May 11, 2026

    @allhuggermugger

    Hitting exact behavior with MacOS Claude Claude Code 2.1.138. 2026-08-11 19:39:33 UTC.

  7. GlobalViewMarc commented on May 13, 2026

    @GlobalViewMarc

    +1, getting same behavior however happening within minutes of not interacting with the session. Running - Version 1.7196.0 of Claude desktop

  8. timfanatics commented on May 14, 2026

    @timfanatics

    +1 getting this issue over and over on my windows 11 pro machine (Version 1.7196.0)

  9. CashflowCode commented on May 14, 2026

    @CashflowCode

    +1 getting this issue since the last Update to Version 1.7196.0

  10. adminwat commented on May 15, 2026

    @adminwat

    +1 macOS — same signature, fresh evidence.

    Environment

    • Claude Code 2.1.119 (Code, not Desktop)
    • macOS 26.3.1 (build 25D2128), arm64
    • Shell: zsh
    • No archive / idle / timeout keys in ~/.claude/settings.json; no archive_session call anywhere in user hooks or installed plugins.

    Reproduction (yesterday, 2026-05-14, same workday, three sessions, no operator action)

    Session JSONL UUID prefix Started (UTC) Stop hook fired (UTC) Last event (UTC) Gap to next session
    19785470… 14:38:46 18:25:03 18:29:03 19 min
    68c50669… 18:48:35 19:34:41 19:38:03 23 min
    098970e4… 20:01:16 23:31:47 23:32:55 —

    All three sessions ended with a clean stop_hook_summary subtype=stop_hook_summary hookCount=4 event — i.e., the harness fired Stop cleanly, not a crash. The JSONLs on disk are intact and resumable. The operator did not run /clear / /compact / close terminal at any of these moments and was mid-conversation each time. This matches @eddyafram's corrected analysis ("~3 min idle, app foregrounded") and the macOS confirmations from @acyberduck and @allhuggermugger.

    Diagnostic plumbing added on my side to confirm signature on next occurrence

    To verify whether each Stop fires at hid_idle_seconds >= ~180 while Claude is the frontmost app (the #57602 signature), I added a diagnostic capture block at the end of my session-end Stop hook that logs the following per fire to a local file (~/.claude/stop-trigger-diagnostics.log):

    • hid_idle_seconds (from ioreg IOHIDSystem)
    • frontmost_app (osascript)
    • pm_assertions, claude_procs, power_state, network, session_id_env, parent_pid, tty

    Code: adminwat/waterlux-claude-config@1b93dc9 (will post the captured log here on the next Mac reproduction).

    Workaround: as noted upstream, the JSONL is intact; new session resumes the conversation via --resume <uuid> if you can pull the session ID. The UI's "archived" pointer is the broken part.

    Happy to share a session UUID privately with Anthropic engineering for server-side correlation.

  11. github-actions commented on Jun 13, 2026

    @github-actions

    Closing for now — inactive for too long. Please open a new issue if this is still relevant.

  12. github-actions commented on Aug 15, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  13. locked as resolved and limited conversation to collaborators on Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:desktopbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:windowsIssue specifically occurs on WindowsstaleIssue is inactive

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions