claude-code - 💡(How to fix) Fix [BUG] Session recap never auto-fires in Claude for Windows desktop GUI [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#55023Fetched 2026-05-01 05:48:14
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×2

Session recap (※ recap: / away-summary) never auto-fires in Claude for Windows desktop (the standalone GUI app), even after weeks of active use across many sessions. The same feature works as expected when claude runs in a real terminal (Linux SSH, Windows Terminal, etc.). Feature is enabled by default; no opt-out via env or /config was applied. Manual /recap not yet tested on the affected host.

Root Cause

Root cause (from claude.exe 2.1.121 string analysis)

Fix Action

Fix / Workaround

Workarounds for users

  • /recap slash command — manual force, bypasses focus check.
  • Run claude directly in Windows Terminal (%USERPROFILE%\AppData\Roaming\Claude\claude-code\2.1.121\claude.exe) instead of the desktop GUI host.

Code Example

function mpH() {
  let H = process.env.CLAUDE_CODE_ENABLE_AWAY_SUMMARY;
  if (isFalsey(H)) return false;
  if (isTruthy(H)) return true;
  if (!growthBook("tengu_sedge_lantern", true)) return false;
  if (Sq()) return false;                 // !isInteractive
  return Cq()?.awaySummaryEnabled !== false;
}

---

ensureInteractive = () => {
  if (this.unsubscribeTTYHandlers || !this.options.stdout.isTTY) return;
  // … only here: this.options.stdout.write(qr)  // qr contains \x1B[?1004h
};
RAW_BUFFERClick to expand / collapse

Summary

Session recap (※ recap: / away-summary) never auto-fires in Claude for Windows desktop (the standalone GUI app), even after weeks of active use across many sessions. The same feature works as expected when claude runs in a real terminal (Linux SSH, Windows Terminal, etc.). Feature is enabled by default; no opt-out via env or /config was applied. Manual /recap not yet tested on the affected host.

Environment

  • Host A (broken): Windows 11 + Claude for Windows desktop app v1.5354.0 (9a9e3d), which embeds Claude Code at %APPDATA%\Claude\claude-code\2.1.121\claude.exe. Sessions logged with entrypoint: "claude-desktop".
  • Host B (working, control): Ubuntu 24.04 LTS, claude v2.1.123, accessed via SSH from Windows Terminal on a separate workstation. Sessions logged with entrypoint: "cli".
  • Both hosts: telemetry on (API Usage Billing), no CLAUDE_CODE_ENABLE_AWAY_SUMMARY set, awaySummaryEnabled not toggled to false, tengu_sedge_lantern: true.

Repro

  1. Install Claude for Windows desktop (the GUI app).
  2. Open the Code tab, start a chat, run any 5+ user turns over the course of normal work.
  3. Switch focus to another window for 5+ minutes, return.
  4. Observe: no ※ recap: line is rendered, no system / away_summary event is persisted to the session JSONL.
  5. Repeat for any number of sessions/days. Recap never fires.

Run the same flow against claude in a real terminal (Windows Terminal, iTerm2, kitty, gnome-terminal, etc.) and recap does fire normally.

Expected vs actual

  • Expected: after focus loss ≥ ~3 min and turn count ≥ 3, recap is generated and rendered on focus return.
  • Actual on Host A: recap never fires. Verified across 125 JSONL session files, 0 entries with type: "system" and subtype: "away_summary", including in a single active session containing 74 user turns over 304 lines.
  • On Host B (control): recap fires routinely; 2 firings in one same-day interactive session.

Root cause (from claude.exe 2.1.121 string analysis)

The recap-eligibility gate mpH():

function mpH() {
  let H = process.env.CLAUDE_CODE_ENABLE_AWAY_SUMMARY;
  if (isFalsey(H)) return false;
  if (isTruthy(H)) return true;
  if (!growthBook("tengu_sedge_lantern", true)) return false;
  if (Sq()) return false;                 // !isInteractive
  return Cq()?.awaySummaryEnabled !== false;
}

returns true in this setup.

But the focus-tracking init in ensureInteractive:

ensureInteractive = () => {
  if (this.unsubscribeTTYHandlers || !this.options.stdout.isTTY) return;
  // … only here: this.options.stdout.write(qr)  // qr contains \x1B[?1004h
};

bails immediately when process.stdout.isTTY === false.

When Claude for Windows desktop spawns the embedded claude.exe, stdout is wired as a pipe to the host React UI, not a PTY. So:

  1. ensureInteractive returns before sending \x1B[?1004h (DECSET 1004, focus reporting).
  2. The host UI never echoes back \x1B[I / \x1B[O (focus-in / focus-out).
  3. Global Ns6 stays at its initial "unknown" and never transitions to "blurred".
  4. The trigger inside function v(R) / function N(R) never fires.
  5. Recap is never generated.

Why it is not a config or feature-flag issue

  • CLAUDE_CODE_ENABLE_AWAY_SUMMARY is unset on both hosts.
  • tengu_sedge_lantern: true on both (from ~/.claude.json / %USERPROFILE%/.claude.json cached GrowthBook features).
  • awaySummaryEnabled not set to false.
  • Host B with identical user-side state fires recaps; Host A never does. The only structural difference is claude-desktop entrypoint with piped stdout vs cli entrypoint with PTY.

Suggested fix paths (non-prescriptive)

The desktop GUI host needs an alternate channel to feed focus state to the embedded process when stdout is a pipe — e.g.:

  • Inject focus-in/focus-out escapes into the child stdin when the host window blur/focus changes.
  • Or expose a programmatic setFocusState(blurred|focused) IPC the embedded CLI listens for instead of DECSET 1004.
  • Or detect claude-desktop entrypoint and switch focus detection to a non-terminal mechanism.

Workarounds for users

  • /recap slash command — manual force, bypasses focus check.
  • Run claude directly in Windows Terminal (%USERPROFILE%\AppData\Roaming\Claude\claude-code\2.1.121\claude.exe) instead of the desktop GUI host.

Related issues (different but same MSIX/subprocess plumbing class)

  • #36156 — Windows hooks receive stdin as TTY instead of pipe (mirror direction of the same kind of bug).
  • #48362 — Claude Desktop MSIX session-persistence EXDEV bug.
  • #48084 / #48863 — recap docs gap (not platform-specific but adjacent).

extent analysis

TL;DR

The most likely fix for the issue is to implement an alternate channel for the desktop GUI host to feed focus state to the embedded process when stdout is a pipe.

Guidance

  • The ensureInteractive function needs to be modified to handle the case where process.stdout.isTTY is false, which occurs when the embedded claude.exe is spawned by the desktop GUI host.
  • One possible solution is to inject focus-in/focus-out escapes into the child stdin when the host window blur/focus changes.
  • Another possible solution is to expose a programmatic setFocusState(blurred|focused) IPC that the embedded CLI listens for instead of DECSET 1004.
  • Users can workaround the issue by using the /recap slash command or running claude directly in Windows Terminal.

Example

No code snippet is provided as the issue requires a more fundamental change to the ensureInteractive function or the addition of a new IPC mechanism.

Notes

The issue is specific to the desktop GUI host and does not occur when running claude in a real terminal. The fix will require changes to the desktop GUI host code to handle the focus state correctly.

Recommendation

Apply a workaround by using the /recap slash command or running claude directly in Windows Terminal, as a permanent fix will require modifications to the ensureInteractive function or the addition of a new IPC mechanism.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Session recap never auto-fires in Claude for Windows desktop GUI [2 comments, 2 participants]