You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The daily-driver dev profile runs every optional diagnostic at once (.env: AGENT_CODE_PERF=1, AGENT_CODE_DEV_DEBUG=1, AGENT_CODE_SESSION_RECORD=1; settings useProxyStreaming, aggressiveDebugPersistence), and several diagnostics have no gate at all:
session recorder: every outbound message on 10 channels, ~1 MB/s stringify on main; 93% of bytes are screen frames; 1.6 GB on disk (86 recordings).
memoryInstrumentation sampler (useIpcSubscriptions.ts:335,624-625): every 30 s per session, stringifies 64 samples even when perf is off.
worktree activity index (WorktreeActivityIndex.ts:31,163-206, indexStore.ts:142-164): 51.8 MB JSON, stringified in full and temp/renamed on every change (0.3–0.5 s main-thread), no retention bucket (debugRetention.ts:354-396) → grows forever.
heap watchdog (heapWatchdog.ts:28,236): first crossing of min(1.5 GiB, 70%) runs a synchronous writeHeapSnapshot — a multi-second stop-the-world freeze with every session live; this IS the "2 GB watchdog freeze".
mitmproxy per session (claudeSession.ts:261,305-317; mitmAddon.py:438-535 open/append/close per SSE chunk): 3.7 GB on disk, 12 live processes, and 20 orphaned mitmdump processes (ppid 1, 2 days old) survived the previous run — not reaped on abnormal exit.
debug-bundle autosave: per pane per 60 s DOM outerHTML + sanitise; 654 MB.
Expected
Gate feed-debug persistence behind dev-debug or a setting; a small sampled ring in packaged builds.
Gate the memory sampler on perf-enabled.
Worktree activity index: cap/TTL, per-project files or append-only, stringify off-thread.
Heap watchdog: on trip, journal an incident and defer the snapshot to idle or a user action; never a synchronous snapshot on a live workspace.
mitmproxy: batch addon writes; reap children on session stop and will-quit; kill stale _shared-conf mitmdump processes at startup; consider one shared proxy.
Diagnostics sink (recorder, perf exporter, feed-debug, ghost/paste/dictation journals) in one utilityProcess/worker; main only postMessages.
Document a "daily" profile: SESSION_RECORD, useProxyStreaming, aggressiveDebugPersistence off; DEV_DEBUG=1 kept for on-demand recording.
Symptom
The daily-driver dev profile runs every optional diagnostic at once (
.env:AGENT_CODE_PERF=1,AGENT_CODE_DEV_DEBUG=1,AGENT_CODE_SESSION_RECORD=1; settingsuseProxyStreaming,aggressiveDebugPersistence), and several diagnostics have no gate at all:memoryInstrumentationsampler (useIpcSubscriptions.ts:335,624-625): every 30 s per session, stringifies 64 samples even when perf is off.WorktreeActivityIndex.ts:31,163-206,indexStore.ts:142-164): 51.8 MB JSON, stringified in full and temp/renamed on every change (0.3–0.5 s main-thread), no retention bucket (debugRetention.ts:354-396) → grows forever.heapWatchdog.ts:28,236): first crossing ofmin(1.5 GiB, 70%)runs a synchronouswriteHeapSnapshot— a multi-second stop-the-world freeze with every session live; this IS the "2 GB watchdog freeze".claudeSession.ts:261,305-317;mitmAddon.py:438-535open/append/close per SSE chunk): 3.7 GB on disk, 12 live processes, and 20 orphanedmitmdumpprocesses (ppid 1, 2 days old) survived the previous run — not reaped on abnormal exit.outerHTML+ sanitise; 654 MB.Expected
will-quit; kill stale_shared-confmitmdump processes at startup; consider one shared proxy.postMessages.SESSION_RECORD,useProxyStreaming,aggressiveDebugPersistenceoff;DEV_DEBUG=1kept for on-demand recording.Refs #722, #748, #750, #733, #734.
Refs #103, #390. Source: architecture audit 2026-09-03 (scratchpad/arch-perf-audit.md).