[BUG] [Claude Code Desktop app on Windows] Periodic input lag caused by 88MB LocalStorage sync and 200ms+ IndexedDB callbacks blocking renderer main thread
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.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗