Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
I checked the storage usage of my Mac and Cursor is using quite a lot of storage. I used Grok 4.5 to investigate the issue and it came back with the following result. It would be nice if you could tell me a) how to investigate this further or b) what steps I could take. I dont want to “just delete” either the whole or parts of the state.vscdb file.
Here is the resulting analysis:
The global state.vscdb on this machine has grown to an extreme size and is dominating local disk use for Cursor.
| File | Size | Notes |
|---|---|---|
state.vscdb (live) |
97.09 GB | Measured 2026-07-17 |
state.vscdb.backup |
3.06 GB | Last written 2026-05-12 — best historical size anchor |
| Implied growth | +94.0 GB in ~66 days | ≈ 1.42 GB/day if treated as roughly continuous |
This matches the known unbounded cursorDiskKV growth reports, but at a more extreme scale than the common 1–20 GB cases.
I have not deleted or renamed the live DB (aware that doing so can cause endless “Loading Chat…”).
What’s inside the 97 GB (read-only SQLite)
Tables:
ItemTable ~1.7k rows
composerHeaders ~2,546 rows (1,163 marked subagent)
cursorDiskKV ~1,147,987 rows ← almost all of the bytes
cursorDiskKV breakdown by key prefix (SUM(LENGTH(value))):
agentKv:% 766,699 rows 91.37 GB
bubbleId:% 355,342 rows 3.95 GB
checkpointId:% 5,855 rows 0.09 GB
composerData:% 2,620 rows 0.28 GB
TOTAL ~96.08 GB of stored values
Of agentKv keys, nearly all are agentKv:blob:… (~767k); only 2 are agentKv:artifact:…
(artifacts point at /opt/cursor/archives/plans/… — tiny, ~17 KB total)
PRAGMA freelist_count ≈ 77 pages → not SQLite free-page bloat; real payload.
Largest individual values sampled were multi‑MB composerData, agentKv:blob:…, and bubbleId:… entries (several in the 4–7 MB range; one composerData ≈ 22 MB).
Separate filesystem agent transcripts under ~/.cursor/projects/*/agent-transcripts are only hundreds of MB total — so most history is inside SQLite, not those folders.
Growth timeline — what we can and cannot prove
Hard size anchors (only two)
There is no Time Machine / no daily size series for this file. The only trustworthy size checkpoints are:
- 2026-05-12 22:09 —
state.vscdb.backup= 3.06 GB
(Cursor’s automatic backup of the live DB at that time) - 2026-07-17 — live
state.vscdb= 97.09 GB
So we can say with certainty:
- On 12 May the DB was already large (~3 GB), but still within the “known painful” range from other reports.
- By 17 July it had become ~97 GB (+94 GB).
- Average rate over that interval ≈ 1.4 GB/day, which is consistent with other “~1 GB/day” forum reports under heavy Agent use.
We cannot claim a single calendar day when the file size jumped 10→50→97 GB, because no intermediate size snapshots exist.
Activity proxy (composer session creation) — best signal for when intensity rose
Using composerHeaders.createdAt as a proxy for Agent/chat session creation (session counts, not bytes per session):
Weekly composers (Apr–Jul 2026):
| Week starting | Composers | Subagents | Main agents |
|---|---|---|---|
| 2026-04-06 | 108 | 68 | 40 |
| 2026-04-13 | 150 | 86 | 64 |
| 2026-04-20 | 165 | 121 | 44 |
| 2026-04-27 | 54 | 29 | 25 |
| 2026-05-04 | 253 | 189 | 64 |
| 2026-05-11 | 95 | 60 | 35 |
| 2026-05-18 | 267 | 125 | 142 |
| 2026-05-25 | 202 | 29 | 173 |
| 2026-06-01 | 110 | 60 | 50 |
| 2026-06-08 | 170 | 42 | 128 |
| 2026-06-15 | 102 | 42 | 60 |
| 2026-06-22 | 170 | 96 | 74 |
| 2026-06-29 | 405 | 111 | 294 |
| 2026-07-06 | 227 | 58 | 169 |
| 2026-07-13 | 68 | 47 | 21 |
Sharpest activity increase: the week of 29 Jun – 5 Jul 2026 (405 new composer sessions — roughly 2× the prior busy weeks).
Peak single day: 2026-07-01 with 119 new composer sessions (35 subagents).
Daily peak window (early July):
| Day | Composers | Subagents |
|---|---|---|
| 2026-07-01 | 119 | 35 |
| 2026-07-02 | 55 | 15 |
| 2026-07-03–11 | 10–83/day | varying |
| 2026-07-12–17 | 1–20/day | mostly subagents |
Possible trigger: Cursor for iOS public beta + “My Machine” / local workers (29 Jun 2026)
I set up My Machine / local agent workers around the phone-app launch. The public dates and local filesystem evidence line up tightly:
| Event | When |
|---|---|
| Cursor for iOS public beta announced | 29 Jun 2026 (blog, changelog) |
First cursor-agent-worker-*.log on this Mac |
29 Jun 22:18 |
com.cursor.local-agent-workers LaunchAgent created (KeepAlive + RunAtLoad) |
29 Jun 22:54 |
| Composer session spike | week of 29 Jun; peak day 1 Jul |
Workers were registered for several repos. That LaunchAgent is unloaded / deactivated now (no worker processes running).
Important: local workers did not store the 97 GB themselves
I checked whether the worker subprocesses were the disk sink for the giant DB. They are not.
Worker-related disk (separate from state.vscdb), ~7.3 GB total:
| Location | Size | Notes |
|---|---|---|
Two worker logs (…5f95884d95.log, …7e19340c59.log) |
~5.7 GB | Verbose INFO Session / Stream text; born 29–30 Jun |
| Other worker logs | ~tens of MB | Same pattern |
anysphere.cursor-agent-worker/agent-cli version caches |
~1.5 GB | 9 CLI bundles (~170–200 MB), versions 19 Jun – 16 Jul |
~/.local/share/cursor-agent |
~160 MB | Runtime |
| LaunchAgent logs | ~24 KB | Negligible |
Evidence workers are not writing into state.vscdb directly:
- Worker IDs from those logs appear 0 times in
cursorDiskKVkeys andcomposerHeadersvalues. - Worker log contents do not mention
state.vscdb/agentKv/bubbleId. - The 97 GB remains almost entirely anonymous
agentKv:blob:…hashes inside the desktop global DB.
Inference on causality (careful)
- Byte growth from May → July is real and severe (3.1 → 97 GB), dominated by
agentKv:blob. - The strongest session-creation spike is late June / early July (week of 29 Jun; peak day 1 Jul) — the same window as iOS launch + My Machine setup on this Mac.
- Plausible mechanism: My Machine / phone-driven / always-on local workers increased Agent traffic; the desktop Cursor app then persisted that history into unbounded
agentKv(indirect accelerator). This is correlation + mechanism fit, not a proven byte-level spike day. - Not plausible: that the worker log/CLI folders are the 97 GB. Those are a separate ~7 GB problem.
- Mid-July (12–16 Jul) was a heavy local disk period for project worktrees / temp jobs on this machine, but new composer counts were comparatively low then — so the DB size is better explained by sustained Agent KV retention from May onward, with an activity surge around 29 Jun–1 Jul, than by a unique mid-July DB event.
- Because the May 12 backup is only 3.1 GB, most of the +94 GB accumulated after 12 May — My Machine may explain acceleration after 29 Jun, but not the pre-existing 3 GB baseline.
Rough mental model:
- Before / around 12 May: DB already ~3 GB.
- Mid-May → late June: continued accumulation under steady-high session rates.
- 29 Jun evening: My Machine / local workers enabled (iOS public beta day).
- ~29 Jun – early Jul: clearest activity spike; highest-probability window for a steeper byte-growth phase.
- By 17 Jul: 97 GB in
state.vscdb(~91 GBagentKv), plus ~7 GB leftover worker logs/CLI caches (workers now off).
Steps to Reproduce
It is highly unlikely that you either want or can reproduce this properly. However, here is a machine-written suggestion for doing so. I think it would be absurd to do so, but this field is required:
- Use Agent mode heavily across multiple large repositories over several weeks (including many subagents).
- Optionally enable My Machine / local agent workers (e.g. after Cursor for iOS) so agents can run on the Mac from phone/cloud.
- Do not prune chat/agent history (no automatic retention appears to run).
- Observe
~/Library/Application Support/Cursor/User/globalStorage/state.vscdband compare againststate.vscdb.backupafter Cursor writes a backup. - Optionally inspect:
sqlite3 "$HOME/Library/Application Support/Cursor/User/globalStorage/state.vscdb" \
"SELECT
CASE
WHEN key LIKE 'agentKv:%' THEN 'agentKv'
WHEN key LIKE 'bubbleId:%' THEN 'bubbleId'
WHEN key LIKE 'checkpointId:%' THEN 'checkpointId'
WHEN key LIKE 'composerData:%' THEN 'composerData'
ELSE 'other'
END AS cat,
COUNT(*),
ROUND(SUM(LENGTH(value))/1024.0/1024.0/1024.0, 2) AS gib
FROM cursorDiskKV
GROUP BY 1
ORDER BY gib DESC;"
Expected Behavior
- Agent/chat persistence should not grow without bound on disk.
- There should be automatic retention / compaction, or a first-class UI control to prune old Agent KV safely.
- Enabling My Machine / local workers should not imply multi‑GB verbose worker logs with no rotation, or unbounded
agentKvgrowth in the desktop DB. - A 3 GB → 97 GB climb over ~2 months (with ~1.4 GB/day average) should be treated as a product bug / missing retention policy, not normal “just how SQLite works.”
Operating System
MacOS
Version Information
Version: 3.12.17 (Universal)
VS Code Extension API: 1.128.0
Commit: 0fb762053c34788bb7760d5673f8a6d4c8589d50
Date: 2026-07-17T02:53:53.006Z
Layout: Agent Window
Build Type: Stable
Release Track: Nightly
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.256
OS: Darwin arm64 25.5.0
For AI issues: add Request ID with privacy disabled
The request ID of the chat I used to investigate this issue: 6bd876d2-010a-4444-b6fd-6fbee4203c1b
Additional Information
- Can you confirm whether ~97 GB / ~1.4 GB/day is within any expected envelope, or should this be treated as pathological retention?
- Is growth after enabling My Machine / local workers (esp. with Cursor for iOS) a known amplifier for
agentKvretention? - Is there a supported way to prune
agentKvwithout breaking chat loading for keep-worthy conversations? - Are there plans for automatic retention / size caps / background compaction — and for worker log rotation?
- If useful for debugging: I can provide additional read-only aggregates (top workspaces by composer count, largest key samples, worker timeline) — prefer not to upload the full 97 GB DB.
- Cursor state.vscdb growing at 1 GB in a day
- Best practices with state.vscdb and state.vscdb.backup in Cursor
- macOS: state.vscdb grew to 12.4 GB and state.vscdb.backup grew to 12.2 GB on a 256 GB MacBook Air; seeking safe remediation guidance
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor