claude-code - 💡(How to fix) Fix [BUG] [Claude Code Desktop app on Windows] Periodic input lag caused by 88MB LocalStorage sync and 200ms+ IndexedDB callbacks blocking renderer main thread [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#55149Fetched 2026-05-01 05:44:59
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2

Error Message

Error Messages/Logs

Root Cause

Claude Code Desktop app on Windows has periodic input lag during typing. Keystrokes appear with 100-200ms delay intermittently (not every keystroke, but several times per sentence). The lag accumulates over time and is temporarily resolved by Help → Troubleshooting → Clear Cache and Restart, but returns within minutes of normal use. Cursor (also Electron) has zero input lag on the same machine. Root cause identified via Developer → Record Performance Trace: three classes of long tasks compete for CrRendererMain thread (pid 25696, tid 25700), blocking input event processing: 1. LocalStorage StorageAreaObserver — 72-99ms block: A single mojo message delivers an 88.5 MB payload to the renderer main thread:

{"cat":"toplevel,mojom","dur":72157,"name":"Receive mojo message",
 "pid":25696,"tid":25700,
 "args":{"chrome_mojo_event_info":{
   "data_num_bytes":92831832,
   "mojo_interface_tag":"blink.mojom.StorageAreaObserver",
   "payload_size":92831776}}}
88 MB in a synchronous IPC message on the renderer main thread is the
primary cause. LocalStorage grows unboundedly during normal use (observed
0.7 MB → 140 MB over hours), explaining why lag worsens over time and
Clear Cache temporarily fixes it.

Fix Action

Fix / Workaround

Claude Code Desktop app on Windows has periodic input lag during typing. Keystrokes appear with 100-200ms delay intermittently (not every keystroke, but several times per sentence). The lag accumulates over time and is temporarily resolved by Help → Troubleshooting → Clear Cache and Restart, but returns within minutes of normal use. Cursor (also Electron) has zero input lag on the same machine. Root cause identified via Developer → Record Performance Trace: three classes of long tasks compete for CrRendererMain thread (pid 25696, tid 25700), blocking input event processing: 1. LocalStorage StorageAreaObserver — 72-99ms block: A single mojo message delivers an 88.5 MB payload to the renderer main thread:

{"cat":"toplevel,mojom","dur":72157,"name":"Receive mojo message",
 "pid":25696,"tid":25700,
 "args":{"chrome_mojo_event_info":{
   "data_num_bytes":92831832,
   "mojo_interface_tag":"blink.mojom.StorageAreaObserver",
   "payload_size":92831776}}}
88 MB in a synchronous IPC message on the renderer main thread is the
primary cause. LocalStorage grows unboundedly during normal use (observed
0.7 MB → 140 MB over hours), explaining why lag worsens over time and
Clear Cache temporarily fixes it.

{"cat":"toplevel","dur":218427,"name":"SimpleWatcher::OnHandleReady",
 "pid":25696,"tid":25700,
 "args":{"chrome_mojo_event_info":{
   "watcher_notify_interface_tag":"blink.mojom.IDBFactory"}}}
3. keypress EventDispatch — 10-12ms (marginal):

{"cat":"devtools.timeline","dur":12026,"name":"EventDispatch",
 "pid":25696,"tid":25700,
 "args":{"data":{"type":"keypress"}}}
12ms per keystroke is close to the 16ms frame budget. When a keystroke
coincides with an IDB callback (218ms) or StorageArea flush (72ms),
the keystroke event waits in the task queue → visible lag.

Code Example

{"cat":"toplevel,mojom","dur":72157,"name":"Receive mojo message",
 "pid":25696,"tid":25700,
 "args":{"chrome_mojo_event_info":{
   "data_num_bytes":92831832,
   "mojo_interface_tag":"blink.mojom.StorageAreaObserver",
   "payload_size":92831776}}}
88 MB in a synchronous IPC message on the renderer main thread is the
primary cause. LocalStorage grows unboundedly during normal use (observed
0.7 MB140 MB over hours), explaining why lag worsens over time and
Clear Cache temporarily fixes it.

2. IndexedDB IDBFactory callbacks — 211-218ms block:

{"cat":"toplevel","dur":218427,"name":"SimpleWatcher::OnHandleReady",
 "pid":25696,"tid":25700,
 "args":{"chrome_mojo_event_info":{
   "watcher_notify_interface_tag":"blink.mojom.IDBFactory"}}}
3. keypress EventDispatch10-12ms (marginal):

{"cat":"devtools.timeline","dur":12026,"name":"EventDispatch",
 "pid":25696,"tid":25700,
 "args":{"data":{"type":"keypress"}}}
12ms per keystroke is close to the 16ms frame budget. When a keystroke
coincides with an IDB callback (218ms) or StorageArea flush (72ms),
the keystroke event waits in the task queue → visible lag.



### What Should Happen?

LocalStorage writes should be batched/debounced and never send 88MB+
payloads synchronously on the renderer main thread
IndexedDB operations should be chunked or moved to a worker thread
Input events should have priority scheduling over storage I/O
Cursor (same Electron framework) achieves zero input lag on identical
hardware, proving this is solvable

### Error Messages/Logs
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Claude Code Desktop app on Windows has periodic input lag during typing. Keystrokes appear with 100-200ms delay intermittently (not every keystroke, but several times per sentence). The lag accumulates over time and is temporarily resolved by Help → Troubleshooting → Clear Cache and Restart, but returns within minutes of normal use. Cursor (also Electron) has zero input lag on the same machine. Root cause identified via Developer → Record Performance Trace: three classes of long tasks compete for CrRendererMain thread (pid 25696, tid 25700), blocking input event processing: 1. LocalStorage StorageAreaObserver — 72-99ms block: A single mojo message delivers an 88.5 MB payload to the renderer main thread:

{"cat":"toplevel,mojom","dur":72157,"name":"Receive mojo message",
 "pid":25696,"tid":25700,
 "args":{"chrome_mojo_event_info":{
   "data_num_bytes":92831832,
   "mojo_interface_tag":"blink.mojom.StorageAreaObserver",
   "payload_size":92831776}}}
88 MB in a synchronous IPC message on the renderer main thread is the
primary cause. LocalStorage grows unboundedly during normal use (observed
0.7 MB → 140 MB over hours), explaining why lag worsens over time and
Clear Cache temporarily fixes it.

2. IndexedDB IDBFactory callbacks — 211-218ms block:

{"cat":"toplevel","dur":218427,"name":"SimpleWatcher::OnHandleReady",
 "pid":25696,"tid":25700,
 "args":{"chrome_mojo_event_info":{
   "watcher_notify_interface_tag":"blink.mojom.IDBFactory"}}}
3. keypress EventDispatch — 10-12ms (marginal):

{"cat":"devtools.timeline","dur":12026,"name":"EventDispatch",
 "pid":25696,"tid":25700,
 "args":{"data":{"type":"keypress"}}}
12ms per keystroke is close to the 16ms frame budget. When a keystroke
coincides with an IDB callback (218ms) or StorageArea flush (72ms),
the keystroke event waits in the task queue → visible lag.



### What Should Happen?

LocalStorage writes should be batched/debounced and never send 88MB+
payloads synchronously on the renderer main thread
IndexedDB operations should be chunked or moved to a worker thread
Input events should have priority scheduling over storage I/O
Cursor (same Electron framework) achieves zero input lag on identical
hardware, proving this is solvable

### Error Messages/Logs

```shell

Steps to Reproduce

Open Claude Code Desktop on Windows Use normally for 10-30 minutes (chat, type, read responses) Start typing in any chat — observe periodic keystroke delays Help → Troubleshooting → Clear Cache and Restart — lag disappears Continue using — lag returns within minutes Developer → Record Performance Trace while typing confirms the StorageArea and IDB long tasks on CrRendererMain

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

Desktop v1.5354.0

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

Diagnostic steps performed (none resolved the issue permanently):

Cleaned 150 sessions → 6 (no effect on lag) Cleared LocalStorage leveldb manually (temporary fix, regrows) Killed orphaned CLI backends releasing 2.3 GB (no effect) Tested Power Plan changes (no effect — CPU at max clock) Tested --disable-spell-checking (no effect) Tested --disable-renderer-backgrounding (no effect) Tested --disable-background-timer-throttling (no effect) Disabled hardware acceleration (no effect) Clear Cache and Restart (temporary fix — the only thing that works, confirming the root cause is cache/storage growth) The trace clearly shows the renderer main thread is blocked by storage I/O, not by rendering, GC, or network. The 88 MB LocalStorage payload is the smoking gun.

extent analysis

TL;DR

The most likely fix involves optimizing LocalStorage writes to prevent large synchronous payloads and prioritizing input events over storage I/O.

Guidance

  • Investigate debouncing or batching LocalStorage writes to prevent 88MB+ payloads from blocking the renderer main thread.
  • Consider moving IndexedDB operations to a worker thread to reduce blocking times.
  • Review the event dispatching mechanism to ensure input events have priority scheduling over storage I/O operations.
  • Analyze the performance trace to identify opportunities for optimization and verify the effectiveness of any changes.

Example

No code snippet is provided as the issue is more related to the architecture and optimization of the application rather than a specific code block.

Notes

The issue seems to be specific to the Claude Code Desktop app on Windows, and the provided information suggests that optimizing storage I/O operations and prioritizing input events could resolve the input lag. However, without access to the codebase, it's challenging to provide a definitive solution.

Recommendation

Apply a workaround by optimizing LocalStorage writes and prioritizing input events, as this approach addresses the identified root cause of the issue and has the potential to significantly reduce input lag.

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