[BUG] [Claude Code Desktop app on Windows] Periodic input lag caused by 88MB LocalStorage sync and 200ms+ IndexedDB callbacks blocking renderer main thread

Status Closed — not planned
Maintainer reply None cached
Activity 7 comments · opened Apr 30, 2026 · closed Jun 1, 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?

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.

View original on GitHub ↗

7 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/51649
  2. https://github.com/anthropics/claude-code/issues/10881
  3. https://github.com/anthropics/claude-code/issues/26302

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

mvgx · 5 months ago

Not a duplicate of any of the three:

  • #51649 — macOS, webview hangs on session switch (MCP server replacement). Different trigger (session switch vs typing), different platform.
  • #10881 — macOS, API request latency degrades over long sessions. Server-side issue, not renderer main thread blocking.
  • #26302 — closest by symptom (Windows UI lag), but entirely different root cause: Cowork VM auto-start + SkillsPlugin polling + GPU compositing overhead. No localStorage/IndexedDB analysis.

This issue has a unique root cause identified via performance trace: an 88.5 MB synchronous LocalStorage payload + 218ms IndexedDB callbacks blocking the renderer main thread. None of the three issues above identify or address this mechanism. Full trace data included in the report.

mvgx · 5 months ago

Update: second performance trace confirms the same root cause, significantly worse.

StorageArea now blocks renderer for 553ms (was 72ms in first trace):

{"dur":552835,"name":"Receive mojo message","pid":9764,"tid":2080,
"args":{"chrome_mojo_event_info":{
"data_num_bytes":85164344,
"mojo_interface_tag":"blink.mojom.StorageArea",
"payload_size":85164288}}}

Additional long tasks in this trace:

  • BeginMainFrame blocked 647ms (renderer can't paint)
  • IOHandler::OnIOCompleted blocked 599ms

All caused by the same ~81 MB LocalStorage sync on the main thread.

The degradation is progressive: 72ms → 553ms within hours of normal use, confirming that LocalStorage grows unboundedly and the blocking payload keeps getting larger.

Workaround: Help → Troubleshooting → Clear Cache and Restart (temporary, lag returns within minutes).

Both trace files available on request.

github-actions[bot] · 4 months ago

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

Vatroslav · 4 months ago

Still happening on 1.10628, see #65045

mariomineiro · 4 months ago

bump

github-actions[bot] · 2 months ago

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.